Trufa
Trufa

Reputation: 40717

Javadoc only generates the Interface comments and not the class implementations

I am confused about something very basic when generating a Javadoc.

Lets say I have an interface:

/**
*Javadoc comment in interface
*
*/
public interface IOne{
    public Comparable[] meth();
}

Then I have a class:

public class ClassOne implemets IOne{
    /**
    *Javadoc comment in class
    *
    */
    public Comparable[] meth(){
        //implementation
    }
}

When I generate the Javadoc:

It generates and apparently correct HTML.

When I go to IOne the documentation for meth() says:

Javadoc comment in class

But it says the exact same thing when I go to the method of the class in meth().

Is this what it is supposed to do?

Where can I find/generate the Javadoc comment in class?

UPDATE:

This is because of the @Override before the comments. I'm reading as to where the override should be there or not.

Upvotes: 1

Views: 1474

Answers (1)

nobeh
nobeh

Reputation: 10039

Use {@inheritDoc} to merge implementation and interface documentation.

Upvotes: 3

Related Questions