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

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

Want to excel in Java? Test your knowledge with our ultimate quiz based on 'Thinking in Java'. Engage with multiple-choice questions and in-depth explanations. Boost your understanding and prepare for your exam with confidence.

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 output is produced when invoking operations on the proxied null object for SnowRemovalRobot?

  1. A list of operations performed by SnowRemovalRobot

  2. A NotSupportedException

  3. An empty list

  4. Detailed logging of each method call

The correct answer is: An empty list

A & D incorrect because they do not return anything and would just add an additional step. B is incorrect because even though the null object pattern throws a NotSupportedException, since it is a proxy, it would return the same output as the original SnowRemovalRobot which is an empty list.