Advanced
Object-Oriented Programming Concepts
Q89 / 100
What is the purpose of the "Null Object" pattern?
Correct! Well done.
Incorrect.
The correct answer is A) To provide an object with neutral ("do nothing") behavior in place of a null reference, avoiding null checks throughout the code
A
Correct Answer
To provide an object with neutral ("do nothing") behavior in place of a null reference, avoiding null checks throughout the code
Explanation
A Null Object implements the expected interface with no-op behavior, so client code can call methods on it safely without special-casing null, reducing defensive checks.
Progress
89/100