1 public class Test{ 2 3 public static void main(String[] args) { 4 5 byte bytes = -42; 6 7 int result = bytes&0xff; 8 System.out.println("无符号数: \t"+result); 9 System.out.println("2进制bit位: \t"+Integer.toBinaryString(result)); 10 } 11 }