Convert Hexadecimal String to Decimal Number using Java

Integer.parseInt method

package app;

public class Main
{
    public static void main(String[] args)
    {
        String hexString = "3c";
        int decimalNumber = Integer.parseInt(hexString, 16);

        System.out.println(decimalNumber);
    }
}

Leave a Comment

Cancel reply

Your email address will not be published.