Appendix H. javadoc Summary
Setting Documentation Comments in Source
A documentation comment is delimited by /**
and */
. You can comment
Classes
Methods
Instance variables
Each comment is placed immediately above the feature it documents.
Each /** ... */
documentation comment contains introductory text followed by tagged documentation. A tag starts with an @
character, such as @author
or @param
. Tags are summarized in Table 1. The first sentence of the introductory text should be a summary statement. The javadoc
utility automatically generates summary pages that extract these sentences.
Table H.1. Common javadoc Tags
Tag | Description |
---|---|
| A parameter of a method. Use a separate tag for each parameter. |
| The return value of a method. |
| An exception that a method may throw. Use a separate tag for each exception. |
| A feature that remains for compatibility but that should not be used for new code. |
#methodName
| A reference to a related documentation entry. |
| The author of a class or interface. Use a separate tag for each author. |
| The version of a class or interface. |
You can use HTML tags such as em
for emphasis, code
for a monospaced font, img
for images, ul
for bulleted lists, and so on.
Here is a typical example. The summary sentence (in color) will be included with the method summary.
/**
Withdraws money ...
Get Big Java, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.