@linkplain 标签的用途是什么,它与@link 有何不同

What is the @linkplain tag used for and how does it differ from @link

我想知道 JavaDoc 标签 @link@linkplain 的区别到底是什么。

它们似乎都生成相同的 html 代码。

它在 javadoc 中产生不同的格式 你可以在 IDE:

试试

{@link #method()} - 等宽格式(代码)

{@linkplain #method()} 标准格式

来自 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.