class TestL { public static void main(String[] args) { int i=60; String binary = Integer.toBinaryString(i); System.out.println(binary); String hex=Integer.toHexString(i); System.out.println(hex); int j=i&15; String k1=(i<=9)?j+"":(char)(j-10+‘a‘)+""; System.out.println(k1); i=i>>4; int z=i&15; String k2=(z<=9)? z + "":(char)(z-10+‘a‘)+""; System.out.println(k2); System.out.println(k2+k1); } }
原文地址:http://9815936.blog.51cto.com/9805936/1600114