参考Sun公司的Java编码规范,半翻译半理解。
/* * Class name * Version info * Copyright notice * Program description */ |
if (condition) {
statements;
}
if (condition) {
statements;
} else {
statements;
}
if (condition) {
statements;
} else if (condition) {
statements;
} else if (condition) {
statements;
}
|
for (initialization; condition; update)
{
statements;
}
|
while (condition) {
statements;
}
|
do {
statements;
} while (condition);
|
switch (condition) {
case ABC:
statements;
/* falls through */
case DEF:
statements;
break;
case XYZ:
statements;
break;
default:
statements;
break;
}
|
try {
statements;
} catch (ExceptionClass e) {
statements;
}
|
原文地址:http://blog.csdn.net/cloume/article/details/45198747