title: convert hexadecimal character string to integer in java
body: <p>I'm begginer in java I'm reading data from serial port and I have stored the data in string array data is 24 byte length.</p>
  
  <p>Data I'm getting as output: 12120814330006050.0 </p>
  
  <p>data also contains hexadecimal character in the string I want to read first character of the string. I have done:</p>
  
  <pre><code>String str=dispArray[i].substring(1,2);
  int i= Integer.parseInt(str,16);
  System.out.println("Decimal:="+ i);
  </code></pre>
  
  <p>But I'm getting  NumberFormatException.plz help me to read hexadecimal character.</p>
  
  <p>Thanks for reply</p>