
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Types of Java comments.
Java supports single-line, multi-line comments, and documentation comments. Documentation comments are understood by Javadoc tool and can be used to create HTML based documentation.
/** is known as documentation comments. It is used by Javadoc tool while creating the documentation for the program code.
/* is used for multi-line comments.
// is used for single line comments
Example
/** * This is a documentation comment. * This is my first Java program. * This will print 'Hello World' as the output * This is an example of multi-line comments. */ public class MyFirstJavaProgram { public static void main(String[] args) { /* This is an example of multi line comment. */ // This is a single line comment. System.out.println("Hello World"); } }
- Related Questions & Answers
- Java comments.
- What are the various types of comments in JavaScript?
- Java documentation comments
- Comments in Java
- /** and /* in Java comments
- Java single line comments.
- Java multi-line comments
- Executable Comments in Java
- Best practices for Java comments.
- What are comments in Java language?
- Types of variable in java
- Types of packages in Java
- Types of inheritance in Java
- Types of Array in Java
- Types of References in Java
Advertisements