bench-fibo

Unnamed repository; edit this file 'description' to name the repository.
git clone https://logand.com/git/bench-fibo.git/
Log | Files | Refs | README

fibo40int3.java (349B)


      1 class fibo40int3 {
      2 
      3     interface Fibo {
      4         int fibo(int n);
      5     }
      6 
      7     public static void main(String args[]) {
      8         System.out.println(new Fibo() {
      9                 public int fibo(int n) {
     10                     if(n < 3) return n;
     11                     else return fibo(n - 1) + fibo(n - 2);
     12                 }
     13             }.fibo(40));
     14     }
     15 }