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

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

Question: 1 / 50

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

System

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().

Formatter

String

Next

Report this question