class VariableTest2 { public static void main(String[] args) { String str1=Integer.toBinaryString(60); String str2=Integer.toHexString(60); System.out.println(str1); System.out.println(str2); int m=60; int i2=m&15; System.out.println(i2); String str3=(i2>9)?(char)(i2-10+'A')+"":i2+""; System.out.println(str3); m=m>>>4; i2=m%15; String str4=(i2>9)?(char)(i2-10+'A')+"":i2+""; System.out.println(str4+str3); } }
使用位运算符进行右移