Search code examples
javaparametersconstructorjavadoc

Javadocs - @param name not found


I am trying to document one of my classes, but I keep getting the same error, and I don't understand why or how I can solve it.

Here is the relevant part of the code :

/** 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);
        }

The error I get when I document is the following :

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 */

My question is the following : What's causing my error and how do I solve it ?


Solution

  • It says the problem correctly. You don't have a parameter called 'health' in your constructor.