int x = 11;
int baseNumber = 2;
String result = Integer.toString(x, baseNumber);
System.out.println(result); // 1011
String x = "1e"; // 1e =Hexadécimal
int baseNumber = 10;
int result = Integer.parseInt(x, baseNumber);
System.out.println(result); // 30
Recommended Posts