A Javadoc is a utility to document Java code in HTML format. The Javadoc documentation is generated from comments and tags added to Java classes or methods. The comments start with the /**
string and end with */
. Inside these comments, tags can be added, such as @param
to describe a method parameter,@throws
to describe an exception that can be thrown by the method, or @version
to indicate the version of the class or method.
The use of a Javadoc is integrated in Android Studio. We can use code completion when typing the Javadoc comments and the documentation will appear in the pop-up tool tips of the code elements.
To generate a complete Javadoc, we have to write the Javadoc comments about our classes and methods. Open the main activity of our project to add the Javadoc comments to the onAcceptClick
method we created in Chapter 5, Creating User Interfaces. Place the caret on the line before the method declaration, type /**
, and press Enter. The Javadoc comments are automatically...