Java examples for Language Basics:int
Convert hexadecimal number to decimal number
public class Main { public static void main(String[] args) { /*from w w w .jav a 2s . c om*/ //declare string containing hexadecimal number 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); } }