1. public class Factorial {
    2. public static void main(String[] args) {
    3. System.out.println(doFactorial(20));
    4. }
    5. public static long doFactorial(long value) {
    6. if (value <= 1) {
    7. return value;
    8. }
    9. return value * doFactorial(value - 1);
    10. }
    11. }