Java - Documentation Comments
Categories: Java 8(JDK1.8)
The Java language supports three types of comments −
Sr.No.Comment & Description
1
/* text */
The compiler ignores everything from /* to */.
2
//text
The compiler ignores everything from // to the end of the line.
3
/** documentation */
This is a documentation comment and in general its called doc comment. The JDK javadoc tool uses doc comments when preparing automatically generated documentation.
This chapter is all about explaining Javadoc. We will see how we can make use of Javadoc to generate useful documentation for Java code.
What is Javadoc?
Javadoc is a tool which comes with JDK and it is used for generating Java code documentation in HTML format from Java source code, which requires documentation in a predefined format.
Following is a simple example where the lines inside /*….*/ are Java multi-line comments. Similarly, the line which preceeds // is Java single-line comment.