public static void ChangeStyle() { System.out.print(" 进制之间的转换 "); int i=192; System.out.print("192转换成2进制是:"+Integer.toBinaryString(i)+" "); System.out.print("192转换成16进制是:"+Integer.toHexString(i)+" "); i=0xf4;//以0x或0X开头的是16进制 System.out.print("0xf4转换成10进制:"+i+" ");//默认输入10进制 System.out.print("0xf4输出16进制:"+Integer.toHexString(i)+" ");//输出16进制 i=072;//以0开头的是8进制 System.out.print("072默认输出10进制:"+i+" "); System.out.print("072输出8进制:"+Integer.toOctalString(i)+" "); }