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

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

Yup, it's called javadoc.

5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest