开发者

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开发者_如何学JAVA overridden method?


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

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


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;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜