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.


What does the 'h' conversion do in Formatter?

  1. Prints Hexadecimal representation

  2. Prints character

  3. Prints hash code as hex

  4. Converts to HTML entities

The correct answer is: Prints hash code as hex

The 'h' conversion in Formatter prints the hash code as a hexadecimal string, making it easy to represent the object. The other options are incorrect because hexadecimals are used to represent numbers in base 16, not characters (option B), and not all objects have a corresponding HTML entity (option D).