public class XXX { private static XXX instance = new Singleton(); private XXX () {} public static XXX getInstance() { return instance; } }
The presented implementation should be well documented, because nothing would be more irritating than a novice developer in your team who doesn't know about this magic behind the scenes and relies on different instances of the singleton class ("I thought new would be doing...").