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.


Why is RandomAccessFile not part of the InputStream or OutputStream hierarchies?

  1. Because it allows seeking within a file

  2. Because it operates on text files only

  3. Because it was added in a later Java version

  4. Because it does not support I/O operations

The correct answer is: Because it allows seeking within a file

RandomAccessFile is not part of the InputStream or OutputStream hierarchies because it allows for random access or seeking within a file, meaning it can read or write at any position within a file. This feature is not supported by the other options provided, which either operate on text files only (B), were added in a later Java version (C), or do not support I/O operations (D).