JAVA SP T


Lets dive into snapshot of my programs!💻

27. How to convert Hex to Decimal.

💡Code:

public class HexToDecimalConversion7078 {
                public static void main(String[] args) {
                    // Example hexadecimal string
                    String hexString = "1A";
            
                    // Convert hex to decimal
                    int decimalValue = Integer.parseInt(hexString, 16);
            
                    // Print the converted decimal value
                    System.out.println("Converted decimal value: " + decimalValue);
                }
            }
            
           

📸Output :

output