Jimmy Huch Jimmy Huch - 4 months ago 14
Java Question

Javadoc multiple variables on single line

I have a class like the following...

class A{

/**
* Blah blah
*/
Type1 var;

/**
* What do I do here?
*/
Type2 var11, var12;

}


How can I javadoc var11, and var12 if they are both on the same line?

I am curious to see if this is possible, I know I can put them both on an individual line and javadoc from there.

Answer

I was curious so I tried it out

/**
 * data stuff
 */
 int x , y ;

The resulting javadoc repeated the same doc comments for both x and y. I imagine this behavior would be useful if two fields were essentially the same with minor differences.

class Circle
{
    ....
    /**
     * center coordinates
     * The x/y coordinate of the center of this circle.
     */
     int x , y ;
Comments