今天在看java Map源码时发现了一个@see 代码片如下
。
/**
* Returns the hash code value for this map. The hash code of a map is
* defined to be the sum of the hash codes of each entry in the map's
* <tt>entrySet()</tt> view. This ensures that <tt>m1.equals(m2)</tt>
* implies that <tt>m1.hashCode()==m2.hashCode()</tt> for any two maps
* <tt>m1</tt> and <tt>m2</tt>, as required by the general contract of
* {@link Object#hashCode}.
*
* @return the hash code value for this map
* @see Map.Entry#hashCode()
* @see Object#equals(Object)
* @see #equals(Object)
*/
int hashCode();
出于好奇总结了一下:
注解@see可以在注释中实现链接跳转.@see可以指向包,类,方法,属性.
使用方法格式:@see Map.Entry#hashCode()
如果指向的在当前类中,可以只写井号后面的.
/**
*@see #field
*@see #method(Type, Type,...)
*/
如果指向的在当前包中,可以省略包名.
/**
*@see Class#field
*@see Class#method(Type, Type,...)
*/
如果在其他包中,需要指向全路径.
/**
*@see package.Class#field
*@see package.Class#method(Type, Type,...)
*/