All challenges
Multiple ChoiceBeginner 45s

Null Object vs Optional

What is the main benefit of the Null Object pattern over returning null?
Options
  1. 1It improves the performance of object creation by reusing shared instances
  2. 2It allows shared state across threads without any explicit synchronization
  3. 3It eliminates all null-related errors by providing a do-nothing neutral implementation
  4. 4It removes the need for interfaces by letting callers check the object type

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle