Javadoc is a tool developed by Oracle, allowing to create API documentation in HTML format from the comments present in a source code in Java.
Originally designed by Sun Microsystems (before its acquisition by Oracle), javadoc is the industry standard for documentation of Java classes. Most IDEs automatically generate javadoc in HTML format.
When commenting on source code, Java developers can signal that a comment needs to be embedded in the documentation using special syntax. A Java comment block starting with / ** will become a Javadoc comment block that will be included in the source code documentation. Javadoc comments usually precede class, attribute, and method declarations. It is also possible to describe a package, by creating a PACKAGE-info.java file in the corresponding folder, in which we include a Javadoc comment.
A Javadoc tag begins with an @ (at sign). The following table shows some of the most common tags:
Why comment on your code?
There are two good reasons for properly commenting out your code. First of all, it allows us to better understand what we have written. But above all, it will facilitate the work of those who would like to understand, use, or even maintain your work.
Javadoc also provides an API to create doclets (To format documentation, javadoc uses a doclet. A doclet allows you to specify the format of the generated documentation. By default, Javadoc offers a doclet that generates documentation in HTML format) and taglets , which allow you to analyze the structure of a Java application.