Mastering Java: The Ultimate Quiz for 'Thinking in Java'

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for your Java exam with our ultimate quiz based on 'Thinking in Java'. Engage with expertly crafted questions that enhance your learning process. Perfect for Java enthusiasts looking to solidify their knowledge!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What does readByte method in FormattedMemoryInput return?

  1. A character

  2. An integer

  3. A boolean

  4. A byte

The correct answer is: A byte

The readByte method in FormattedMemoryInput returns a single byte of data from the input stream. This is different from a character (A) as a byte is a unit of data measurement while a character is a symbol from a set of symbols used to represent things like letters and numbers. An integer (B) is also a unit of data measurement, but it is typically larger than a byte and used to represent whole numbers. A boolean (C) is a data type with a value of either true or false and is not relevant to the readByte method. Therefore, the correct answer is D A byte.