How to convert hexadecimal to decimal in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        String hex = "FF";  
        
        int decimal = Integer.parseInt(hex, 16);  
        
        System.out.println(decimal);  
    }
}



 
/*
run:
 
255
 
*/

 



answered Aug 16, 2021 by avibootz
...