关于java文档注释添加url链接

因为之前没有认真系统学习过javadoc,看到@link直接认为是添加url,死活添加不上url链接,上google一查,果然理解错误,@link是为了方便注释比如我有两个方法getInt()和getInt(int i),如果getInt(int i)已经有了文档注释,那么我们可以利用@link来链接到getInt(int i)的文档注释

@link 语法

{@link  package.class#member label}

而想为文档注释添加url链接可以使用@see,比如

@see http://google.com

参考资料:

http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html

http://stackoverflow.com/questions/1082050/linking-to-an-external-url-in-javadoc

猜你喜欢

转载自blog.csdn.net/xu13879531489/article/details/80565465