Problem Statement
What is a practical risk of the Singleton pattern in large systems?
Explanation
Singletons act like globals. They hide dependencies and make order of initialization tricky. Tests become hard because state leaks across cases.
Prefer dependency injection and scoped lifetimes. If a single instance is required, enforce it at composition root, not inside the class.
Code Solution
SolutionRead Only
class Config { private static final Config I = new Config(); static Config get(){ return I; } }