有没有办法从方法文档正文中添加对一个或多个方法参数的引用?就像是:
/**
* When {@paramref a} is null, we rely on b for the discombobulation.
*
* @param a this is one of the parameters
* @param b another param
*/
void foo(String a, int b)
{...}
原文由 ripper234 发布,翻译遵循 CC BY-SA 4.0 许可协议
据我在阅读 javadoc 的文档 后所知,没有这样的功能。
不要按照其他答案中的建议使用
<code>foo</code>
;您可以使用{@code foo}
。当您引用诸如{@code Iterator<String>}
类的泛型类型时,知道这一点尤其好——当然看起来比<code>Iterator<String></code>
更好,不是吗!