//break跳出内循环continue只结束本轮进入下一轮不跳出循环
package test;public class ForBreak { public static void main(String[] args) {
int i=;
For: for (;; i++) {
For: for (;; i+=) {
if(i>){
Systemoutprintln(i>:+i);
i=;
Systemoutprintln(i:+i);
break;//jump out inner
}
if (i % == ) {
Systemoutprintln(i%:+i);
break For;//jump to for next;
} else if (i % == ) {
Systemoutprintln(i%:+i);
break For;//jump to for next;
}else{
Systemoutprintln(i);
}
}//end for
Systemoutprintln(for next);
}//end for
Systemoutprintln(for next);
Systemoutprintln(exit);
}}
==========================
输出
i%:
for next
i>:
i:
for next
i%:
for next
i%:
for next
exit