Review Questions

Review Questions

12.27 Which classes in the Java API provide both forms of the format() method?

format(String formatStr, Object... args)format(java.util.Locale l, String formatStr, Object... args)

Select the four correct answers.

(a) java.lang.String

(b) java.util.StringBuilder

(c) java.io.PrintStream

(d) java.io.PrintWriter

(e) java.util.Scanner

(f) java.util.Formatter

(g) java.util.Console

12.28 Which classes in the Java API provide both forms of the printf() method?

printf(String formatStr, Object... args)printf(java.util.Locale l, String formatStr, Object... args)

Select the two correct answers.

(a) java.lang.String

(b) java.util.StringBuilder ...

Get A Programmer’s Guide to Java™ SCJP Certification: A Comprehensive Primer, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.