Javadocs - 找不到@param 名称

Adr*_*cha 1 java parameters constructor javadoc

我正在尝试记录我的一个课程,但我不断收到同样的错误,我不明白为什么或如何解决它。

这是代码的相关部分:

/** Set the health. 
    @param health The health of the enemy */
    public void setHealth(float health) {
        this.health = maximum_health;
    }

    /** initialising */
    public void initialise() {
        setName("NONE");
    }

    /** Constructor for the base enemy
    @param name The name of the enemy
    @param health The health of the enemy */
    public BaseEnemy(String name) { 
        initialise();
        setName(name);
        setHealth(health);
        }
Run Code Online (Sandbox Code Playgroud)

我记录时遇到的错误如下:

Generating code/classes/docs/baseDoc/com/ama747/enemies/BaseEnemy.html...
code/src/BaseEnemy/BaseEnemy.java:27: error: @param name not found
    @param health The health of the enemy */
Run Code Online (Sandbox Code Playgroud)

我的问题如下:是什么导致了我的错误,我该如何解决?

小智 6

它正确地说明了问题。您的构造函数中没有名为“health”的参数。