the singleton instance is only created the first time helper class is loaded. Subsequent calls to getInstance() return the existing instance since it's declared as static.
Java guarantees that static fields are initialized only once, even in a multi-threaded environment.
How Bill pugh is singleton, everytime the helper classes will be loaded, then the instance will be created, right?
the singleton instance is only created the first time helper class is loaded. Subsequent calls to getInstance() return the existing instance since it's declared as static.
Java guarantees that static fields are initialized only once, even in a multi-threaded environment.