parseInt() Method, parse int hexadecimal to int Decimal in java

Java Programming Language / Number Class in java

957

Program:

public class ParseHexadecimal  {

   public static void main(String args[]) {

      int b = Integer.parseInt("F",16);

      System.out.println(b);
   }
}

/*
parseInt(int i) - This returns an integer, given a string
representation of decimal, binary, octal, or hexadecimal
(radix equals 10, 2, 8, or 16 respectively) numbers as input.

*/

Output:

15
Press any key to continue . . .

This Particular section is dedicated to Programs only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.