42

I am wondering what exactly is the difference of the JavaDoc tags @link and @linkplain.

They both seem to generate the same html code.

kerner1000
  • 3,382
  • 1
  • 37
  • 57

2 Answers2

39

It produces different formatting in javadoc you can try it in IDE:

{@link #method()} - monospaced formatting (code)

{@linkplain #method()} standard formatting

Example:

enter image description here

srk
  • 4,857
  • 12
  • 65
  • 109
Maciej
  • 1,954
  • 10
  • 14
26

From Oracle documentations:

@link

Inserts an in-line link with visible text label that points to the documentation for the specified package, class or member name of a referenced class. This tag is valid in all doc comments: overview, package, class, interface, constructor, method and field, including the text portion of any tag (such as @return, @param and @deprecated).

@linkplain

Identical to {@link}, except the link's label is displayed in plain text than code font. Useful when the label is plain text.

ultraon
  • 2,220
  • 2
  • 28
  • 27