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

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

Dive into the depths of Java with our quiz based on "Thinking in Java, Fourth Edition" by Bruce Eckel. Test your knowledge, solidify concepts, and prepare for certification with challenging questions and insightful feedback.

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.


In which class is the method format() that is modeled after C's printf() introduced?

  1. System

  2. PrintStream

  3. Formatter

  4. String

The correct answer is: PrintStream

PrintStream is the correct answer because it is the class where the method format() is located. The other choices, System, Formatter, and String, do not contain the method format() and therefore cannot be the correct answer. System is a class that contains utility methods, Formatter is a class used for formatting data for output, and String is a class for storing and manipulating strings of characters. None of these options would contain a method specifically modeled after C's printf().