import java.lang.Integer ;
public static int parseInt(String s , int radix) ;
//其他进制到十进制
System.out.println(Integer.parseInt("100", 10));
System.out.println(Integer.parseInt("100", 2));
System.out.println(Integer.parseInt("100", 8));
System.out.println(Integer.parseInt("100", 16));
System.out.println(Integer.parseInt("100", 23));
//NumberFormatException
//System.out.println(Integer.parseInt("123", 2));
运行结果:
100
4
64
256
529
|
|