This commit is contained in:
Ingy döt Net 2013-04-10 16:57:12 -07:00
parent 518da4a923
commit 764da6cbbb
6144 changed files with 83610 additions and 11 deletions

View file

@ -0,0 +1,29 @@
class U0 extends Exception { }
class U1 extends Exception { }
public class ExceptionsTest {
public static void foo() throws U1 {
for (int i = 0; i <= 1; i++) {
try {
bar(i);
} catch (U0 e) {
System.out.println("Function foo caught exception U0");
}
}
}
public static void bar(int i) throws U0, U1 {
baz(i); // Nest those calls
}
public static void baz(int i) throws U0, U1 {
if (i == 0)
throw new U0();
else
throw new U1();
}
public static void main(String[] args) throws U1 {
foo();
}
}