二进制转十进制
十进制转二进制
代码中二进制转十进制
String binarySource = "100";
BigInteger bi = new BigInteger(binarySource, 2); //转换为BigInteger类型
System.out.println( Integer.parseInt(bi.toString()));
二进制转十进制
十进制转二进制
代码中二进制转十进制
String binarySource = "100";
BigInteger bi = new BigInteger(binarySource, 2); //转换为BigInteger类型
System.out.println( Integer.parseInt(bi.toString()));