JAVA编码规范(开发培训讲义)模板课件.ppt
- 【下载声明】
1. 本站全部试题类文档,若标题没写含答案,则无答案;标题注明含答案的文档,主观题也可能无答案。请谨慎下单,一旦售出,不予退换。
2. 本站全部PPT文档均不含视频和音频,PPT中出现的音频或视频标识(或文字)仅表示流程,实际无音频或视频文件。请谨慎下单,一旦售出,不予退换。
3. 本页资料《JAVA编码规范(开发培训讲义)模板课件.ppt》由用户(晟晟文业)主动上传,其收益全归该用户。163文库仅提供信息存储空间,仅对该用户上传内容的表现方式做保护处理,对上传内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(点击联系客服),我们立即给予删除!
4. 请根据预览情况,自愿下载本文。本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
5. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007及以上版本和PDF阅读器,压缩文件请下载最新的WinRAR软件解压。
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- JAVA 编码 规范 开发 培训 讲义 模板 课件
- 资源描述:
-
1、Lishoulin,PTC普联软件(中国)有限公司2011年度入职培训,济南燕山学院PANSOFTJULY,2011编码规范(JAVA版)JAVA之路JAVA开发人员编码规范Technology Team Progresscom.pansoft.financecom.pansoft.public class JRaster;class JImageSprite interface IRasterDelegate;interface IStoring;run();runFast();getBackground();char c;int i;float myWidth;int mEmployeeI
2、d;String mName;Customer mCustomer;public void callMe(int pAge,String pName)static final int MIN_WIDTH =4;static final int MAX_WIDTH =999;static final int GET_THE_CPU =1;/*Classname *Version information *Date *Copyright notice */package java.awt;import java.awt.peer.CanvasPeer;/正常断行 someMethod(int an
3、Arg,Object anotherArg,String yetAnotherArg,Object andStillAnother)./若断行后很靠右,则下面行可以缩进8个空格,看上去更美 观。private static synchronized horkingLongMethodName(int anArg,Object anotherArg,String yetAnotherArg,Object andStillAnother)./缩小过少,不易阅读1 if(condition1&condition2)2|(condition3&condition4)3|!(condition5&con
4、dition6)4 doSomethingAboutIt();/这一行不易阅读识别 /较多的缩进,便于阅读5 if(condition1&condition2)6|(condition3&condition4)7|!(condition5&condition6)8 doSomethingAboutIt();1 alpha=(aLongBooleanExpression)?beta:gamma;2 alpha=(aLongBooleanExpression)?beta :gamma;3 alpha=(aLongBooleanExpression)?beta :gamma;/*Here is a
5、block comment.*/1 if(condition)2 /*Handle the condition.*/3 /code.4 1 if(a=2)2 return TRUE;/*special case*/3 else 4 return isPrime(a);/*works only for odd a*/5 1 if(foo 1)2./Do a double-flip.3 4 else 5.return false;/Explain why here.6 7./if(bar 1)8 /Do a triple-flip.9 /10 /else 11 /return false;12 /
6、*The Example class provides.*/public class Example .1 int level;/indentation level2 int size;/size of table /这样不好 3 int level,size;4 int foo,fooarray;/错误写法错误写法1 void myMethod()2 int int1=0;/好的声明3 if(condition)4 int int2=0;/不好的声时5 .6 7 1 class Sample extends Object 2 int ivar1;3 int ivar2;4 Sample(in
7、t i,int j)5 ivar1=i;6 ivar2=j;7 8 int emptyMethod()9 .10 1 argv+;/Correct 2 argc-;/Correct 3 argv+;argc-;/AVOID!1 if(this.isExist(“0001”)2 argc-;/Correct 3 System.out.println(“HELLO”);4 1.return;2.return myDisk.size();3.return(size?size:defaultSize);1.if(condition)2 statements;3 4 if(condition)5 sta
8、tements;6 else 7 statements;8 9 If(condition)10 statements;11 else if(condition)12 statements;13 else 14 statements;15 if(condition)/非法的,应该以包括 statement;for(initialization;condition;update)statements;while(condition)statements;while(condition);do statements;while(condition);1 switch(condition)2 case
展开阅读全文