Here you can find the source of factorial(int n)
public static long factorial(int n)
//package com.java2s; //License from project: Open Source License public class Main { public static long factorial(int n) { return (n < 2) ? n : (n * factorial(n - 1)); }/* w w w . jav a 2 s . c om*/ }