BASIC CONSTRUCTS

28.How to convert Decimal to Hex

            public class DecimalToHex {
                public static void main(String[] args) {
                    int decimal = 10; // Example decimal number
                    String hex = Integer.toHexString(decimal);
                    System.out.println(hex.toUpperCase());
                }
            }     
        

OUTPUT

            A