87
Java Convert Hexadecimal to Decimal
We can convert hexadecimal to decimal in java using Integer.parseInt() method or custom logic.
Java Hexadecimal to Decimal conversion: Integer.parseInt()
The Integer.parseInt() method converts string to int with given redix. The signature of parseInt() method is given below:
Let’s see the simple example of converting hexadecimal to decimal in java.
Output:
10
Let’s see another example of Integer.parseInt() method.
Output:
10 15 289
Java Hexadecimal to Decimal conversion: Custom Logic
We can convert hexadecimal to decimal in java using custom logic.
Output:
Decimal of a is: 10 Decimal of f is: 15 Decimal of 121 is: 289
Next TopicJava Decimal to Hex