diff options
Diffstat (limited to 'libjava/classpath/testsuite/java.lang/ExceptionTest.java')
-rw-r--r-- | libjava/classpath/testsuite/java.lang/ExceptionTest.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libjava/classpath/testsuite/java.lang/ExceptionTest.java b/libjava/classpath/testsuite/java.lang/ExceptionTest.java new file mode 100644 index 0000000..7a464db --- /dev/null +++ b/libjava/classpath/testsuite/java.lang/ExceptionTest.java @@ -0,0 +1,21 @@ +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()); + } + } +} |