In java doc comments is @see used with {@link } or without?

时间:2015-07-28 16:57:11

标签: java javadoc

When I want to put comment to see the other method which one is correct? With {@link ClassName#methodName} or without?

/**
 * @see ClassName#methodName
 *
 * @see {@link ClassName#methodName}
 */

1 个答案:

答案 0 :(得分:1)

@see中,已包含可点击链接,使@link变得多余。如果您想创建可点击链接,请在其他任何地方使用@link。如果没有,请不要。就这么简单。

/**
 * Blah blah {@link SomeClass#foo}.
 * 
 * @see SomeClass#bar
 * @see {@link SomeClass#baz}
 */

底部两个将生成相同。 SomeClass#foo也是一个可点击的链接。