go to previous page   go to home page   go to next page

Answer:

In order to return values that can't be represented in Java data type byte.


Signed and Unsigned

An unsigned byte holds a zero or positive value. An unsigned byte in a file holds values 0 to +255. But, in Java (regardless of computer platform), the primitive type byte holds an integer in the range -128 to +127. So the method uses data type int which can hold the negative values from 128 to 255.


QUESTION 8:

(Review: ) What happens when readInt() reaches the end of the file?


go to previous page   go to home page   go to next page