View RSS Feed

My Java Tips

Javadoc tags

Rate this Entry
by , 11-09-2011 at 06:40 PM (454 Views)
JavaDoc 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
*/

Submit "Javadoc tags" to Facebook Submit "Javadoc tags" to Digg Submit "Javadoc tags" to del.icio.us Submit "Javadoc tags" to StumbleUpon Submit "Javadoc tags" to Google

Tags: None Add / Edit Tags
Categories
Java SE

Comments