CODING:
public class ConvertHexToDecimalExample
{
public static void main(String[] args)
{
String strHexNumber = "20";
int decimalNumber = Integer.parseInt(strHexNumber, 16);
System.out.println("Hexadecimal number converted to decimal number");
System.out.println("Decimal number is : " + decimalNumber);
}
}
OUTPUT:
public class ConvertHexToDecimalExample
{
public static void main(String[] args)
{
String strHexNumber = "20";
int decimalNumber = Integer.parseInt(strHexNumber, 16);
System.out.println("Hexadecimal number converted to decimal number");
System.out.println("Decimal number is : " + decimalNumber);
}
}
OUTPUT:
Hexadecimal number converted to decimal number
Decimal number is : 32
Hexadecimal number converted to decimal number
Decimal number is : 32
Comments
Post a Comment