title: Java recursive method to find factorial returns negative output
body: <p>I know it is overflow but the thing is 20 is relatively small number this should not happen right? is there a better approach to find factorial of large numbers such as 1000 with out getting this bizarre result?</p>
  
  <pre><code>public class RecursiveFunctionsExamples {
  
  public int factorial(Integer n)
  {
      Integer res;
      if(n == 0){ 
          res = 1;
      }else{
         res =  n * factorial(n-1);
      }
  
      return res;
  }
  
  
  public static void main(String[] args) {
      System.out.println(new RecursiveFunctionsExamples().factorial(20));
  }
  }
  </code></pre>