Javatpoint Logo
Javatpoint Logo

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.

Test it Now

Output:

10

Let's see another example of Integer.parseInt() method.

Test it Now

Output:

10
15
289

Java Hexadecimal to Decimal conversion: Custom Logic

We can convert hexadecimal to decimal in java using custom logic.

Test it Now

Output:

Decimal of a is: 10
Decimal of f is: 15
Decimal of 121 is: 289





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA