javadoc

Is there a way to write a single line javadoc comment, like in doxygen /**<*/


I would like to comment a variable like I used to do in doxygen and I wonder if there is a way to comment variables after declaring them in the same line. (I've never used javadoc before =/ ).

So instead of:

enum Example1 {
    /** one something */
    ONE,
    /** this means other something */
    OTHER,
    /** the rest of them as a separate value, due to ISSUE-88 */
    NONE,
}

One would have:

enum Example {
    ONE, /// one something
    OTHER, /// this means other something
    NONE, /// the rest of them as a separate value, due to ISSUE-88
}

That is one line per item instead of two (as per standard formatting guidelines, which puts the Javadoc into a separate line).

NOTE: I used triple-slash as a fictional "single line javadoc" syntax


Solution

  • Yes, you can use /** comment */.