Convert Decimal Number to Hexadecimal String using Java

Integer.toHexString method

package app;

public class Main
{
    public static void main(String[] args)
    {
        int decimalNumber = 60;
        String hexString = Integer.toHexString(decimalNumber);

        System.out.println(hexString);
    }
}

Leave a Comment

Cancel reply

Your email address will not be published.