public class MyFactorial {
int factorial(int n) {
if(n==1) return n;
return n*factorial(n-1);
}
public static void main(String[] args) {
MyFactorial myFactorial = new MyFactorial();
System.out.println(myFactorial.factorial(5));
}
}