Why does a 10000 byte not give maximum weight byte?



  • Why do you have to do it? int c = 10000 type bytethe variable becomes equal 16Not 128the maximum value byte?

    int c = 10000;
    byte d = (byte) c;
    System.out.println(d);
    


  • You don't quite understand how the types are being introduced.

    Attempt int to byte There is no " best approach " . There is a different way: " senior " baytes are simply thrown away.

    10000 = 0x2710 consists of two byte: 0x27 and 0x10. Senior White's dropping off, left junior 0x10 = 16.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2