关于 @Override 方法的注释

6

我的问题不是一个编程问题。

我必须为JavaDoc注释我的代码,但我认为重新注释现有方法有点奇怪(我想到@Override方法)。

例如,我重写了onListItemClick方法,有没有办法“重定向”用户到被覆盖的方法的注释?

2个回答


8

尝试使用{@inheritDoc}属性。这应该可以满足您的需求。

您还可以在此标签之前或之后添加一些额外的帮助注释。以下是来自Android源代码的示例:

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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接