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

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

Mastering Java: The Ultimate Quiz for 'Thinking in Java'. Dive deep into Java with multiple-choice questions. Challenge yourself with quiz questions designed to test and improve your understanding of the 'Thinking in Java' book. Get ready for your exam!

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.