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

📄 exceptiontest3.java.bak

📁 Java程序设计培训教程2
💻 BAK
字号:
class customExcep extends Exception {
	public customExcep() {}
	public customExcep(String strObj) {
		super(strObj);
	}
}
public class ExceptionTest3 {
	public static void exceptionThrow() throws customExcep {
		System.out.println(
		"Throwing Exception from exceptionThrow()");
		throw new customExcep();
	}
	public static void anotherThrow() throws customExcep {
		System.out.println(
		"Throwing Exception from anotherThrow()");
		throw new customExcep("Generated from anotherThrow()");
	}
	public static void main(String[] args) {
		try {
			System.out.println("one exception throught out:");
			exceptionThrow();
		} catch(customExcep e) {
			e.printStackTrace();
		}
		try {
			System.out.println("another exception throught out:");
			anotherThrow();
		} catch(customExcep e) {
			e.printStackTrace();
		}
	}
}

⌨️ 快捷键说明

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