This is the effect of taking the remainder modulo 256 of the int b and adding 256 if the value is negative; that is,p. 10: In the line of code near the top of the page the greater than sign should be greater than or equals; that is,
b = b % 256 >= 0 ? b % 256 : 256 + b % 256;
More simply, using bitwise operators,
b = b & 0x000000FF;
int unsignedByte = signedByte >= 0 ? signedByte : 256 + signedByte;
p. 10: In the fifth paragraph change "the absolute value of the number"
to "The absolute value of a negative number"p. 13: EBCDIC is more often an eight-bit character set than a seven-bit set (but only IBM knows for sure in all the different versions of EBCDIC that exist)
p. 21: In the second paragraph of the System.out
section change
"Hello World" to "Hello World!"
p. 23: In the first paragraph on the page, change
For example, if the user types "Hello World", the following bytes will be read from System.in in this order:to
For example, if the user types "Hello World!" and hits the return or enter key, the following bytes will be read from System.in in this order: