title: Failing to convert String to int in this program
body: <p>I am getting an error when converting a string to an int on line 8.</p>
  
  <p>The integer parseInt method doesn't seem to be doing its job.</p>
  
  <p>I have tried to use other methods to convert the string but nothing is working and its causing me to fail this coding challenge I'm doing. I have cut the rest of the code because the error in my logic is in these lines.</p>
  
  <p>The error message reads</p>
  
  <pre><code>
  
       java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
         at java.lang.Integer.parseInt(Integer.java:583)
         at java.lang.Integer.parseInt(Integer.java:615)
      at Solution.reverseNum(Solution.java:35)
          at Solution.main(Solution.java:8)
  
  </code></pre>
  
  <pre><code>
      public class Solution {
          public static void main(String args[] ) throws Exception {
              String sc = "1234567890123456";
              int noCases = 1;
              for(int i=0; i&lt;noCases; i++){
                  int rev = reverseNum(sc); 
              } // for each credit card number
          }
  
          public static int reverseNum(String inp){ // helper function
              int in =Integer.parseInt(inp); 
              int res  = 0;
              for(int i = in; i !=0; i/=10){
                  res = res *10 + i%10;
              }
              return res;
          }
      }
  
  </code></pre>