文字列の 16 進数を 10 進数値に変換したいのですが、Integer.decode を使用しましたが、値はユーザーが書き込む必要があります。
package hexa;
import java.util.Scanner;
public class Hexa {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String str1;
System.out.print("Ingrese el hexadecimal= ");
str1 = in.nextLine();
System.out.println("From hex: " + Integer.decode("#str1"));
}
}