jdk工具类____java进制之间的转换
package com.binary.string.test;
public class Conver {
public static void main(String[] args) {
System.out.println("十进制转二进制___:"+Integer.toBinaryString(10));
System.out.println("二进制转十进制___:"+Integer.valueOf("1010",2));
System.out.println("十进制转八进制____:"+Integer.toOctalString(10));
System.out.println("八进制转十进制____:"+Integer.valueOf("10",8));
System.out.println("十进制转十六进制___:"+Integer.toHexString(10));
System.out.println("十六进制转十进制___:"+Integer.valueOf("a",16));
}
}
//
运行结果