Fariba
Fariba

Reputation: 723

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

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}
 */

Upvotes: 1

Views: 97

Answers (1)

Captain Man
Captain Man

Reputation: 7715

In a @see, the clickable link is already included, making @link redundant. Everywhere else if you want to make a clickable link then use @link. If not, don't. Simple as that.

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

The bottom two will be generated the same. SomeClass#foo will also be a clickable link.

Upvotes: 1

Related Questions