如何向方法或类添加描述

Tal*_*lha 11 java netbeans javadoc

如何在Java中添加方法描述?我使用NetBeans IDE.

JavaDoc示例

Sud*_*kar 17

使用javadoc评论 - /**这是评论*/

请查看此链接以获取详细文档http://en.wikipedia.org/wiki/Javadoc


Lak*_*hmi 15

您可以使用/**comments*/使用javadocs

对于基本上你可以拥有的方法

/**
The Desciption of the method to explain what the method does
@param the parameters used by the method
@return the value returned by the method
@throws what kind of exception does this method throw
*/
Run Code Online (Sandbox Code Playgroud)

您可以使用此链接获得更多帮助http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html#descriptions


Cap*_*ash 6

在您的方法上方写注释应该可以实现您想要的示例:

/** 
This method does some serious stuff 
*/
public int getN()
{
return n;
}
Run Code Online (Sandbox Code Playgroud)

如果您使用 javadocs,它应该是方法的描述。