写continue;
continue是表示结束本次循环,继续下一次循环。
break表示结束整个循环,继续执行循环后面的代码。
/*
* for me, this is a time, in which never write java code.
* e-mail:qinchuanqing918@sina.com
* data:2015/5/22
* author:qcq
* */
package com.nokia;
public class MapIter {
public static void main(String[] args) {
int counter = 0;
while(counter++ <= 100){
if (0 == counter % 2){
continue;
} else {
System.out.print(counter + ",");
}
}
}
}
写continue