What are the best examples of the Singleton design pattern in the Java APIs? Is the Runtime
class a singleton?
Note singletons should be used with care and reflection. Consider the arguments against singletons and your situation before you implement one. Overuse of singletons is an anti-pattern - similar to global variables.
Singleton Wiki Article
Java Dev on Singletons
Why Singletons are Evil
I've used them in the past and see some benefit to them. I've also been highly annoyed when trying to do test driven development with them around that's one area where they are evil. Also inheriting from them results in some hard to understand behaviour - at least in Python - I don't know for sure in Java. Generally you just don't do it because of that. So like threading these seem like a great idea at first and then you run into the pitfalls and realize well maybe this isn't so good after all.