exceptiontest.java

来自「linux下编程用 编译软件」· Java 代码 · 共 22 行

JAVA
22
字号
public class ExceptionTest {  static int foo() throws ArrayIndexOutOfBoundsException {    int f[] = new int[10];    return f[26];   }  public static void main (String args[]) {    int f;    try {      f = foo();    }    catch (ArrayIndexOutOfBoundsException e) {      System.out.println("PASSED: " + e.toString());    } catch (Exception e) {      System.out.println("FAILED: " + e.toString());    }  }}

⌨️ 快捷键说明

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