public static void main(String[] args) {
byte b1=(byte)0x12,b2=(byte)0x34,b3=(byte)0x56,b4=(byte)0x78;
int i=(b4 & 0xff)<<24 | (b3 & 0xff)<<16 | (b2 & 0xff)<<8 | (b1 & 0xff);
System.out.println(i);
}
int i=(b4 & 0xff)<<24 | (b3 & 0xff)<<16 | (b2 & 0xff)<<8 | (b1 & 0xff);
有沒有大神幫忙解釋下為什么要& o0xff以及這個 | 的操作?
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/270220.html
標籤:Java相關
