Cannot convert String to Integer in Java
<p>I am newbie to Java and I have written function to convert string to integer</p>

<pre><code>   if ( data != null )
   {
        int theValue = Integer.parseInt( data.trim(), 16 );
        return theValue;
   }
   else
       return null;
</code></pre>

<p>I have a string which is 6042076399 and it gave me errors:</p>

<pre><code>Exception in thread "main" java.lang.NumberFormatException: For input string: "6042076399"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:461)
</code></pre>

<p>Is this not the correct way to convert string to integer?</p>

<p>Thanks
Ding</p>
