Why does my recursive factorial method always return 0? [duplicate]
问题 This question already has answers here : Why does Java think that the product of all numbers from 10 to 99 is 0? (9 answers) Closed 4 years ago . I have created a recursive method to calculate the facortial of a number, however, it is always returning 0, and I can not see why. I have provided my code below: public class projectTwenty { public static void main(String [] args) { int factorialAns = factorial(100); System.out.println(factorialAns); } private static int factorial(int n) { if (n ==