question archive Can you add comments to each line of this program? import java
Subject:Computer SciencePrice: Bought3
Can you add comments to each line of this program?
import java.util.Scanner;
import java.math.BigInteger;
public class MyClass {
public static BigInteger factorial(int number) {
if (number <= 1)
return BigInteger.ONE;
else
return factorial(number - 1).multiply(BigInteger.valueOf(number));
}
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
BigInteger number = in .nextBigInteger();
System.out.println("Factorial of " + number + " is: " + (factorial(number.intValue())));
}
}