Encapsulating collections within a Singleton class
Filed under Oracle
The question
Explain whether exposing an internal ArrayList of a Singleton class to external classes breaks the Singleton design pattern, and demonstrate how to prevent external callers from mutating the internal list.
No write-up yet. Related questions below have one.
Related Oracle questions
Collected from public candidate posts and coding forums. Updated Nov 2026.