I am wondering what exactly is the difference of the JavaDoc tags @link
and @linkplain
.
They both seem to generate the same html code.
It is shorthand that tells the java docs to insert a link to the desired place when they are being viewed. For instance when you view the javadocs for whatever method has that inside your IDE you'll be shown a link that will take you to the KeyEvent.
{@linkplain} : Forces the link's text to appear as normal text, without a monospace font.
Writing Javadoc Comments In general, Javadoc comments are any multi-line comments (" /** ... */ ") that are placed before class, field, or method declarations. They must begin with a slash and two stars, and they can include special tags to describe characteristics like method parameters or return values.
It produces different formatting in javadoc you can try it in IDE:
{@link #method()}
- monospaced formatting (code)
{@linkplain #method()}
standard formatting
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With