我尝试为扩展另一个类的抽象类创建javadocs。但是在javadoc树中,子类不可见。我使用intellij-idea来完成此操作,并使用src>javadoc GraphicObject.java生成javadoc 在终端中。我想将树生成为,
- GraphicObject
- Rectangle
但它仅显示,
/\*\*
\*
\*
*/
public abstract class GraphicObject {
/*\*
\* The x-coordinate of the graphic object.
*/
protected int x;
/*\*
\* The y-coordinate of the graphic object.
*/
protected int y;
/*\*
\* The width of the graphic object.
*/
protected int width;
/*\*
\* The height of the graphic object.
*/
protected int height;
/*\*
\* Constructs a new graphic object with the specified coordinates, width, and
\* height.
\*
\* @param x the x-coordinate
\* @param y the y-coordinate
\* @param width the width
\* @param height the height
*/
public GraphicObject(int x, int y, int width, int height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
/*\*
\* Moves the graphic object to the specified coordinates.
\*
\* @param x the new x-coordinate
\* @param y the new y-coordinate
\*/
public abstract void move(int x, int y);
}
/\*\*
* This is a subclass of GraphicObject that represents a rectangle.
*
*
* @see GraphicObject "This class extends GraphicObject."
\*/
class Rectangle extends GraphicObject {
public Rectangle(int x, int y, int width, int height) {
super(x, y, width, height);
}
@Override
public void move(int x, int y) {
this.x = x;
this.y = y;
}
}