codegen: handle exceptions of a method
[mate.git] / tests / Fib.java
index 0ae8017c7c1e3eb729477172342c60e48fb38290..871b03f32592e8fb665a98eda5e7c307b3f16776 100644 (file)
@@ -1,14 +1,14 @@
-public class Fib
-{
-       public static int fib(int n)
-       {
-               if(n<=1) return 1;
-               else return fib(n-1) + fib(n-2);
+package tests;
+
+public class Fib {
+       public static int fib(int n) {
+               if (n <= 1)
+                       return 1;
+               else
+                       return fib(n - 1) + fib(n - 2);
        }
 
-       public static void main(String[] args)
-       {
-               for (int i = 0; i < 10; i++)
-                       System.out.println(i + ": " + fib(i));
+       public static void main(String[] args) {
+               System.out.printf("result: 0x%08x\n", fib(20));
        }
 }