JAVA代码注释范例

上传人:hs****ma 文档编号:496741186 上传时间:2023-06-24 格式:DOC 页数:6 大小:30KB
返回 下载 相关 举报
JAVA代码注释范例_第1页
第1页 / 共6页
JAVA代码注释范例_第2页
第2页 / 共6页
JAVA代码注释范例_第3页
第3页 / 共6页
JAVA代码注释范例_第4页
第4页 / 共6页
JAVA代码注释范例_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《JAVA代码注释范例》由会员分享,可在线阅读,更多相关《JAVA代码注释范例(6页珍藏版)》请在金锄头文库上搜索。

1、文档供参考,可复制、编制,期待您的好评与关注! JAVA代码注释范例作者: 周建东日期: 2007-10-18 03:31字体大小: 小 中 大 整个类文件注释 示例如下:/* (#)Object.java 1.61 03/01/23* Copyright 2003 Sun Microsystems, Inc. All rights reserved.* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.*/package java.lang;注释结构:/* (#)类名称.java 创建时间* 某人或某公司具有完全的版权

2、* 使用者必须经过许可*/package java.lang;2. 具体类功能注释示例如下:/* Class Object is the root of the class hierarchy. * Every class has Object as a superclass. All objects, * including arrays, implement the methods of this class. * author unascribed* version 1.61, 01/23/03* see java.lang.Class* since JDK1.0*/public cla

3、ss Object 注释结构:/* 类 类名称此类功能描述 * author 作者* version 版本,常用时间代替* see java.lang.Class* since JDKjdk版本*/public class Object 3. 类变量注释示例如下:/* The value is used for character storage. */private char value;注释结构:/* 此值是用来存储/记录什么的*/private String str ;4. 类方法注释示例如下: /* * Returns a new string that is a substring

4、of this string. The * substring begins with the character at the specified index and * extends to the end of this string. * Examples: * * unhappy.substring(2) returns happy * Harbison.substring(3) returns bison * emptiness.substring(9) returns (an empty string) * * * param beginIndex the beginning i

5、ndex, inclusive. * return the specified substring. * exception IndexOutOfBoundsException if * beginIndex is negative or larger than the * length of this String object. */public String substring(int beginIndex) return substring(beginIndex, count);注释结构: /* * 方法的功能/动作描述 * * param 引入参数名 引入参数说明 * return

6、返回参数名 返回参数说明 * exception 说明在某情况下,将发生什么异常 */public String substring(int beginIndex) return substring(beginIndex, count);5. 类方法中代码块注释示例如下:/* 调用持久化类,将数据保存到库* * 判断是添加,还是修改*/boolean ifSucc = false;if(request.getParameter(YINGLI_ID)=null) String GUID = new RandomGUID().toString(); stressTestDataBean.setUS

7、ER_ID(Integer.toString(userId); stressTestDataBean.setSIGN_ISBN(String)vSectNum.get(0); stressTestDataBean.setSHENHE_JIEGUO(0); stressTestDataBean.setGUID(GUID); stressTestDataBean.setCREATE_DATE(getdate(); stressTestDataBean.setSTATE(A); ifSucc = StressTestDataDao.addStressTestData(db,stressTestDat

8、aBean);else ifSucc = StressTestDataDao.mendStressTestData(db,stressTestDataBean);注释结构:/* 功能描述* * 具体实现动作*/boolean ifSucc = false;if(request.getParameter(YINGLI_ID)=null) String GUID = new RandomGUID().toString(); stressTestDataBean.setUSER_ID(Integer.toString(userId); stressTestDataBean.setSIGN_ISBN(

9、String)vSectNum.get(0); stressTestDataBean.setSHENHE_JIEGUO(0); stressTestDataBean.setGUID(GUID); stressTestDataBean.setCREATE_DATE(getdate(); stressTestDataBean.setSTATE(A); ifSucc = StressTestDataDao.addStressTestData(db,stressTestDataBean);else ifSucc = StressTestDataDao.mendStressTestData(db,stressTestDataBean); /

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 行业资料 > 国内外标准规范

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号