codegen: handle exceptions of a method
[mate.git] / tests / Exception3.java
1 package tests;
2
3 public class Exception3 {
4         public static void main(String []args) {
5                 try {
6                         throw new NullPointerException();
7                 } catch (NullPointerException _) {
8                         System.out.printf("NullPointerException\n");
9                 } catch (IllegalArgumentException _) {
10                         System.out.printf("IllegalArgumentException\n");
11                 }
12                 try {
13                         throw new NullPointerException();
14                 } catch (IllegalArgumentException _) {
15                         System.out.printf("IllegalArgumentException\n");
16                 } catch (NullPointerException _) {
17                         System.out.printf("NullPointerException\n");
18                 }
19                 try {
20                         throw new IllegalArgumentException();
21                 } catch (NullPointerException _) {
22                         System.out.printf("NullPointerException\n");
23                 } catch (IllegalArgumentException _) {
24                         System.out.printf("IllegalArgumentException\n");
25                 }
26                 try {
27                         throw new IllegalArgumentException();
28                 } catch (IllegalArgumentException _) {
29                         System.out.printf("IllegalArgumentException\n");
30                 } catch (NullPointerException _) {
31                         System.out.printf("NullPointerException\n");
32                 }
33                 System.out.printf("hmmm\n");
34         }
35 }