BASIC CONSTRUCTS

27. How to convert Hex to Decimal

            public class HexToDecimal {
                public static void main(String[] args) {
                    String hexStr = "A"; // Example hex number
                    int decimal = Integer.parseInt(hexStr, 16);
                    System.out.println(decimal);
                }
            }  
        

OUTPUT

            10