In this example, we will use valueOf method of integer wrapper class to convert hexadecimal to decimal number.
Source Code
package com.beginner.examples;
public class ConvertHexadecimalToInteger {
public static void main(String[] args) {
String strhex = "3c";
// Use the parseInt() method in the Integer class to parse an Integer
int n = Integer.parseInt(strhex, 16);
System.out.println(n);
}
}
Output:
60