示例#1
0
 public static void main(String[] args) {
   int i = -1;
   print(Integer.toBinaryString(i));
   i >>>= 10;
   print(Integer.toBinaryString(i));
   long l = -1;
   print(Long.toBinaryString(l));
   l >>>= 10;
   print(Long.toBinaryString(l));
   short s = -1;
   print(Integer.toBinaryString(s));
   s >>>= 10;
   print(Integer.toBinaryString(s));
   byte b = -1;
   print(Integer.toBinaryString(b));
   b >>>= 10;
   print(Integer.toBinaryString(b));
   b = -1;
   print(Integer.toBinaryString(b));
   print(Integer.toBinaryString(b >>> 10));
 }
示例#2
0
 static void printBinaryLong(String s, long l) {
   print(s + ", long: " + l + ", binary:\n    " + Long.toBinaryString(l));
 }