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

📄 finaldemo.java

📁 JAVA程序设计课程中各章节的程序实例。
💻 JAVA
字号:
/**
*Using finally
*2004.11.2. xhcprince
*/
class finalDemo
{
	static void procA()
	{
		try
		{
			System.out.println("Inside procA");
			throw new RuntimeException("DemoA");
		}
		finally
		{
			System.out.println("procA is finally");
		}
	}

	static void procB()
	{
		try
		{
			System.out.println("Inside procB");
			throw new RuntimeException("DemoB");
		}
		finally
		{
			System.out.println("procB is finally");
		}
	}

	static void procC()
	{
		try
		{
			System.out.println("Inside procC");
			throw new RuntimeException("DemoC");
		}
		finally
		{
			System.out.println("procC is finally");
		}
	}	

	public static void main(String args[])
	{
		System.out.println("Exception caught");
		procA();
		procB();
		procC();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -