java 什么是java中的文档字符串?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3728253/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 03:11:26  来源:igfitidea点击:

What are docstrings called in java?

javadocumentation-generationnomenclature

提问by tttppp

Before Java methods we have something like:

在 Java 方法之前,我们有类似的东西:

/**
 * Takes a number and returns its square root.
 * @param x The value to square.
 * @return The square root of the given number.
 */
public float getSqrt(float x) {
...
}

Does this have a name (like docstrings in Python)?

这有名字吗(比如 Python 中的文档字符串)?

采纳答案by Buhake Sindi

Actually, they are called document commentsand javadocis a tool to generate those comments into HTML.

实际上,它们被称为文档注释,javadoc是将这些注释生成为 HTML 的工具。

You can find the structure of the Javadoc comment in Wikipedia(for example).

您可以在维基百科中找到 Javadoc 评论的结构(例如)。

回答by Riduidel

Yup, it's called javadoc.

是的,它被称为javadoc