codegen: handle exceptions of a method
[mate.git] / tests / Exception4.java
diff --git a/tests/Exception4.java b/tests/Exception4.java
new file mode 100644 (file)
index 0000000..03495fd
--- /dev/null
@@ -0,0 +1,20 @@
+package tests;
+
+public class Exception4 {
+       public static void main(String []args) {
+               try {
+                       throw new NullPointerException();
+               } catch (NullPointerException _) {
+                       System.out.printf("NullPointerException\n");
+               } finally {
+                       System.out.printf("it's finally over\n");
+               }
+
+               try {
+                       System.out.printf("I'm fine\n");
+               } finally {
+                       System.out.printf("o rly\n");
+               }
+               System.out.printf("hmmm\n");
+       }
+}