java_3种注释语句
1.内容解释// 内容单行注释/* 内容 */多行注释/*** 内容 */文档注释2.多行注释 与 文档注释的区别
多行注释:
https://img2023.cnblogs.com/blog/3104955/202308/3104955-20230810213809076-2095752597.png
https://img2023.cnblogs.com/blog/3104955/202308/3104955-20230810214859861-712326895.png
文档注释:JDK提供工具javadoc解析 注释的内容,为生成API文档做准备
https://img2023.cnblogs.com/blog/3104955/202308/3104955-20230810213751027-1888761575.png
https://img2023.cnblogs.com/blog/3104955/202308/3104955-20230810214919190-982719911.png
3.生成步骤
https://img2023.cnblogs.com/blog/3104955/202308/3104955-20230810213830450-997438562.png
https://img2023.cnblogs.com/blog/3104955/202308/3104955-20230810213840237-2059568585.png
https://img2023.cnblogs.com/blog/3104955/202308/3104955-20230810213851316-988822918.png
https://img2023.cnblogs.com/blog/3104955/202308/3104955-20230810213909958-1970528315.png
4.javadoc标签
标签描述示例@author作者@authorliudelantu@deprecated指名一个过期的类或成员@deprecateddescription{@docRoot}指明当前文档根目录的路径DirectoryPath@exception标志一个类抛出的异常@exceptionexception-name explanation{@inheritDoc}从直接父类继承的注释Inherits acomment from the immediate surperclass.{@link}插入一个到另一个主题的链接{@linkname text}{@linkplain}插入一个到另一个主题的链接,但是该链接显示纯文本字体Inserts anin-line link to another topic.@param说明一个方法的参数@paramparameter-name explanation@return说明返回值类型@returnexplanation@see指定一个到另一个主题的链接@seeanchor@serial说明一个序列化属性@serialdescription@serialData说明通过writeObject( ) 和 writeExternal( )方法写的数据@serialDatadescription@serialField说明一个ObjectStreamField组件@serialFieldname type description@since标记当引入一个特定的变化时@sincerelease@throws和@exception标签一样.The@throws tag has the same meaning as the @exception tag.{@value}显示常量的值,该常量必须是static属性。Displaysthe value of a constant, which must be a static field.@version版本@version1.05.规范
类,方法的注释,要用javadoc的方式写,为了在生成的API文档上 说明此类或方法的用途
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
页:
[1]