grgvn
grgvn

Reputation: 1329

Comments on @Override methods

My question is not really a programming problem..

I must comment my code for the JavaDoc, but I think it's a bit strange to re-comment existing methods (I think about @Override methods).

For example, I override the method onListItemClick, is there a solution to "redirect" the user to the comment of the overridden method?

Upvotes: 6

Views: 2141

Answers (2)

Op De Cirkel
Op De Cirkel

Reputation: 29463

Use: /** {@inheritDoc} */ or {@link package.class#member label}

http://download.oracle.com/javase/1.4.2/docs/tooldocs/windows/javadoc.html#{@inheritDoc}

Upvotes: 13

inazaruk
inazaruk

Reputation: 74780

Try {@inheritDoc} attribute. This should do what you need.

You also can add some additional help comments after or before this tag. Here is an example from android source code:

/**
 * {@inheritDoc}
 *
 * Note that if you're calling on a local binder, this always returns true
 * because your process is alive if you're calling it.
 */
public boolean isBinderAlive() {
    return true;
}

Upvotes: 8

Related Questions