Construct an on-demand initialization

Report a typo

Construct on-demand initialization. Put the getInstance method as the first class member.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                return NestedSingletonHelper.singletonObject;
              
                public class Singleton {
              
                public static Singleton getInstance() {
              
                }
              
                public static Singleton singletonObject = new Singleton();
              
                }
              
                private static class NestedSingletonHelper {
              
                }
              
___

Create a free account to access the full topic