boolean sig = false;
signal1: for (int i = 0; i < 3; i++) {
System. out .println("i = " + i);
for (int j = 0; j < 100; j++) {
if (j == 8)
break signal1;
System. out .print(" j = " + j);
}
sig = true ;
System. out .println("In signal 1" );
}
System. out .println("out Loops " );
if (sig == true) {
System. out .println("外层循环未被break" );
} else
System. out .println("所有循环break" );
}
break 标签;break 跳出制定块,可以是任何块{},但是块内必须包含break 标签;