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

📄 throwsdemo.java

📁 JAVA编程思想源代码 值得一下 很难找的
💻 JAVA
字号:
package chapter14;

public class ThrowsDemo {

	public static void compute() throws ArithmeticException,
			ArrayIndexOutOfBoundsException {
		System.out.println("the method compute");
		int[] x = new int[3];
		for (int i = 0; i <= 3; i++) {
			System.out.println(x[i]);
		}
	}

	public static void main(String[] args) {

		try {
			compute();
		} catch (ArithmeticException e) {
			System.out.println("数学运算错误");
		} catch (ArrayIndexOutOfBoundsException e) {
			System.out.println("数组越界错误");
		}

	}

}

⌨️ 快捷键说明

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