1: 2: public class Singleton { 3: 4: public static Singleton getInstance() { 5: return theInstance; 6: } 7: 8: private Singleton() { 9: // initializing instance fields 10: } 11: 12: private static Singleton theInstance = new Singleton(); 13: 14: // instance fields and methods 15: 16: }