我在考虑这样的想法:
public static void main(String[] args) {
int i;
String s = "0b00110001";
i = Integer.decode(s);
System.out.print(s);
}
Integer.parseInt()
来完成类似这样的操作。 - TheLostMindSystem.out.println(0b00110001)
,它将打印出 49。 - Jaroslaw Pawlak