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

Answer:

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


Signed and Unsigned

An unsigned integer is zero or positive. In Java (regardless of computer platform) the primitive type byte holds an integer in the range -128 to +127. An unsigned byte holds values 0 to +255, so something larger than datatype byte is needed. Data type int is returned because it is used more often than the other integer types.


QUESTION 8:

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