Its not thread safe, multiple threads might compete for getInstance() and 2 threads might end up with totally different instances. One approach to solve this is by using double checked locking
, but that has its own share of concerns like the Instance being available to a different thread even before the initialising thread has completed the initialisation i.e initializing the state.
In the book Effective Java
this concept has been clearly explained.