Home  >  Q&A  >  body text

java中有符号整型转换成无符号整型的意义在哪里?

PHP中文网PHP中文网2741 days ago388

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-18 10:44:57

    Take byte as an example. The range specified by Java is -128~127, but if you think of it as an unsigned number, the range is 0~255.
    Obviously -128 < 127, but when compared as an unsigned number, -128 (will be regarded as 128) is greater than 127.

    reply
    0
  • Cancelreply