Here you can find the source of factorial(int c)
public static double factorial(int c)
//package com.java2s; // it under the terms of the GNU General Public License as published by // public class Main { public static double factorial(int c) { if (c < 0) throw new IllegalArgumentException("Can't take the factorial of a negative number: " + c); if (c == 0) return 1; return c * factorial(c - 1); }/*from w w w .j a v a2 s .c o m*/ }