Here you can find the source of fibonacci(int n)
public static int fibonacci(int n)
//package com.java2s; //License from project: Apache License public class Main { public static int fibonacci(int n) { if (n < 2) return n == 0 ? 0 : 1; return fibonacci(n - 1) + fibonacci(n - 2); }//from w w w .j ava 2 s . c o m }