javadoc中{@link}与@see的区别

来源:互联网 发布:如何找淘宝小二 编辑:程序博客网 时间:2024/05/07 09:51

There are no official guidelines on this, but the facts are:

  • {@link} is an inline link and can be placed wherever you like
  • @see creates its own section

In my opinion, {@link} is best used when you literally use a class, field, constructor or method name in your description. The user will be able to click through to the javadoc of what you've linked.

I use the @see annotation in 2 cases:

  • Something is very relevant but not mentioned in the description.
  • I refer to the same thing multiple times in the description, and it is used as a replacement for multiple links to the same.

I based this opinion on randomly checking out documentation for a great variety of things in the standard library.


转自

0 0
原创粉丝点击