JavaDoc:在哪里添加注释/备注到文档? [英] JavaDoc: where to add notes/remarks to documentation?
问题描述
在C#中编码时,我总是发现标签备注
对提供有关类或方法实现的注释非常有用,或者提供有关什么的理论的信息我正在实施。我现在正在使用Java,但我找不到合适的JavaDoc标记。也许在Java中你以不同的方式完成这个,有人知道吗?
When coding in C# I have always found the tag remarks
very useful for providing notes about the implementation of a class or method, or to give information about the theory of what I was implementing. I am now using Java but I can't find an appropriate JavaDoc tag for this. Maybe in Java you accomplish this in a different manner, does anybody know?
推荐答案
据我所知,没有用于注释或备注的任何专用Javadoc标记。通常,Javadoc的第一句应该给出类/方法/字段的简要描述。然后应该完整描述。如果你想要包含任何音符,一个带有Note:前缀的专用段就足够了。
As far as I know, there isn't any dedicated Javadoc tag for notes or remarks. Generally, the first sentence of Javadoc should give a brief description of the class/method/field. Then the full description should follow. And if you want to include any notes, a specialized paragraph with a "Note:" prepended should suffice.
/**
* Brief description. Full description of the method, generally without
* implementation details.
* <p>
* Note: Additional information, e.g. your implementation notes or remarks.
* </p>
* @param input description of the parameter
* @return description of return value
*
* @since version
* @author name of the author
*/
public boolean doSomething(String input)
{
// your code
}
这篇关于JavaDoc:在哪里添加注释/备注到文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!