plz i try to make factorial program but i have mistake
import java .util.Scanner;
public class Factorialrec {
int fact(int n) {
int result;
if ( n ==1) return 1;
result = fact (n-1) * n;
return result;
}
}
public static void main(String [] args){
Scanner input = new Scanner(System.in);
int z;
Factorialrec c=new Factorialrec();
System.out.println("Enter number");
z=input.nextInt();
System.out.println("is factorial "+c.fact(z));
}