I was initially surprised that Java decides to specify that byte
is signed, with a range from -128..127
(inclusive). I'm under the impression that most 8-bit number representations are unsigned, with a range of 0..255
instead (e.g. IPv4 in dot-decimal notation).
So has James Gosling ever been asked to explain why he decided that byte
is signed? Has there been notable discussions/debates about this issue in the past between authoritative programming language designers and/or critics?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…