📄 labeledfor.java
字号:
/*
*标签使用测试
*/
public class LabeledFor
{
public static void main(String[] args)
{
outer:
for (int i = 0; i < 5; i++)
{
System.out.println("i = " + i);
inner:
for(int j = 0; j < 3; j++)
{
System.out.println("j = " +j);
if(j % 2 == 0)
{
System.out.println("continue inner");
continue inner;//中断内部循环体当次循环
}
if(i % 2 == 1)
{
System.out.println("continue outer");
continue outer;//中断外部循环体当次循环
}
if( i == 3)
{
System.out.println("break outer");
break outer;//中断外部循环体
}
}
}
System.out.println("this is all over!");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -