This program consists of two functions in one class. It demonstrates a recursive function to calculate the factorial of a number.

package factorials;
public class Factorials
{
public static void main(String args[])
{
int y = 5;
System.out.print("\n\t" + y + " factorial = " + getFactorial(y) + "\n");
}
public static double getFactorial(int inum)
{
if (inum == 0) return 1;
else return inum * getFactorial(inum - 1);
}
}

what if i want to make factorial of user inputs? how to do it?