less than 1 minute read

{@link [<package>.]<class>[#<method>]}
{@link #<method>}

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

@see

加一个 see also 外链:

@see <a href="http://google.com">Google</a>

以下两种写法效果相同:

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

@code

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.

Tags:

Categories:

Updated:

Comments