aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/java/recursive-factorial/com/example/RecursiveFactorial.java
blob: eeafcd2c4b8cb07b7b90db236ef0833287e94c40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package com.example;

/**
 *  
 *
 */
public class RecursiveFactorial {
    public static int factorial(int n) {
        if (n == 1) {
            return 1;
        } else {
            return n * factorial(n - 1);
        }
    }
}