package ch.usi.inf.sp.dbi;

public class Application {
    public static void main(String... args) {
        fib(5);
        final Parent[] children = new Parent[] {new Child(), new Child2()};
    }

    public static int fib(int n) {
        if (n == 0) {
            return return0();
        } else if (n == 1) {
            return return1();
        } else {
            return fib(n - 1) + fib(n - 2);
        }
    }

    private static int return1() {
        return 1;
    }

    private static int return0() {
        return 0;
    }

    static class Parent {
        static {
            fib(1);
        }
    }

    static class Child extends Parent {
        static {
            fib(3);
        }
    }

    static class Child2 extends Parent {
        static {
            fib(2);
        }
    }
}
