package
com.test;
public
class
Factorial {
public
int
f (
int
n) {
if
(n == 1){
return
1;
}
else
{
int
k = f(n-1);
return
k*n;
}
}
public
static
void
main(String ags[]){
Factorial fact =
new
Factorial();
int
result = fact.f(4);
System.
out
.println(result);
}
}