public class Continue
{
public static void main(String [] args)
{
L1:
for(int i = 0; i < 5; ++i)
{
if(i == 2)
{System.out.println(i);
continue L1; }
L2:
for(int j = 0; j < 5; ++j)
{
if(i == 3 && j == 3)
{System.out.println(j);
continue L1; }
else
if(j == 4)
{System.out.println(j);
continue L2; }
System.out.println("i == " + i + " j == " + j);
}
if(i == 5)
break;
}
}
}
i == 0 j == 0
i == 0 j == 1
i == 0 j == 2
i == 0 j == 3
4
i == 1 j == 0
i == 1 j == 1
i == 1 j == 2
i == 1 j == 3
4
2
i == 3 j == 0
i == 3 j == 1
i == 3 j == 2
3
i == 4 j == 0
i == 4 j == 1
i == 4 j == 2
i == 4 j == 3
4
continue label,跳到label处,并且跳过continue的外层迭代