⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 labeledfor.java

📁 编程之道--java程序设计入门源代码
💻 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 + -