How to use @link, @see and @code in JavaDoc

Yao Yao on October 12, 2013
{@link [<package>.]<class>[#<method>]}
{@link #<method>}

引用其他类或者方法,注意方法前的 # 与 UML 中表示 protected 的 # 不同(参 visibility symbol in UML),这个 # 仅仅用来连接方法和类


加一个 see also 外链:

@see <a href="">Google</a>


@see [<package>.]<class>
@see {@link [<package>.]<class>} 


Multiple line code example in Javadoc comment

 * <pre>
 * {@code
 * Set<String> s;
 * System.out.println(s);
 * }
 * </pre>


Another unfortunate, if you have blocks in your example code using curly braces “{}”, the first closing brace will terminate the @code block.

blog comments powered by Disqus