Here you can find the source of fib(int n)
public static int fib(int n)
//package com.java2s; //License from project: Open Source License public class Main { public static int fib(int n) { if (n == 0) return 0; else if (n == 1) return 1; else/*from w w w .ja v a 2 s . c o m*/ return fib(n - 1) + fib(n - 2); } }