Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are docstrings called in java?

Before Java methods we have something like:

/**  * 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)?

like image 808
tttppp Avatar asked Sep 16 '10 15:09

tttppp


People also ask

What are Javadoc tags?

The javadoc TagsRepresents the relative path to the generated document's root directory from any generated page. Adds a comment indicating that this API should no longer be used. Adds a Throws subheading to the generated documentation, with the classname and description text.

What is Javadoc style?

Javadoc (originally cased JavaDoc) is a documentation generator created by Sun Microsystems for the Java language (now owned by Oracle Corporation) for generating API documentation in HTML format from Java source code.

How do you write comments in Java?

Single-line comments start with two forward slashes ( // ). Any text between // and the end of the line is ignored by Java (will not be executed).


2 Answers

Actually, they are called document comments and javadoc is a tool to generate those comments into HTML.

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

like image 106
Buhake Sindi Avatar answered Sep 22 '22 21:09

Buhake Sindi


Yup, it's called javadoc.

like image 30
Riduidel Avatar answered Sep 20 '22 21:09

Riduidel