Javadoc tags
23 November 2007JavaDoc comments start with a forward slash and two asterisks (/**) and ends with one asterisk and a forward slash (*/). Everything between the delimiters (even if it spans multiple lines) is a comment.
/**
* @author Gapper
* @version 1.0
*/One has to use javadoc tags. The following are special tags in Javadoc that have predefined purposes.
@see
It is used to create links to other javadoc documentation.
Example:
/**
* @see packagename.class.method
*/@param
It is used to document a single parameter. Parameter name comes first and then comes the description.
Example:
/**
* @param empCode Employee code employee for which the data is required.
*/@return
It is used to document the return value of a method
Example:
/**
* @return Returns no of employees.
*/@exception
It is used to document the exception thrown by the method. Exception name comes first and then the description.
Example:
/**
* @exception UnknownId Employee Id is not known.
*/@deprecated
Used to mark a method as deprecated which means it wont be supported in the next versions.
@author
It is used to specify the author name.
Example:
/**
* @author Laiq
*/@version
If you want to mention version of your class, this tag should be used.
Example:
/**
* @verison 2.0
*/@since
It is used to specify a version that shows when the tagged entity was added to your system
Example:
/**
* @since 2.0
*/Related Posts:
Top Of Page | Trackback
If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.
It will look like this: Javadoc tags