What are docstrings called in java?

tttppp picture tttppp · Sep 16, 2010 · Viewed 23.4k times · Source

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

Answer

Buhake Sindi picture Buhake Sindi · Sep 16, 2010

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).