Javatpoint Logo
Javatpoint Logo

Java Convert Decimal to Hexadecimal

We can convert decimal to hexadecimal in java using Integer.toHexString() method or custom logic.

Java Decimal to Hex conversion: Integer.toHexString()

The Integer.toHexString() method converts decimal to hexadecimal. The signature of toHexString() method is given below:

Let's see the simple example of converting decimal to binary in java.

Test it Now



Java Decimal to Hex conversion: Custom Logic

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

Test it Now


Hexadecimal of 10 is: A
Hexadecimal of 15 is: F
Hexadecimal of 289 is: 121

Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA