Most of the answers here are correct about why it is broken, but are incorrect or suggesting dubious strategies for a solution.
If you really, really must use a singleton (which in most cases you should not, as it destroys testability, combines logic about how to construct a class with the class's behavior, litters the classes that use the singleton with knowledge of how to get one, and leads to more brittle code) and are concerned about synchronization, the correct solution is to use a static initializer to instantiate the instance.
private static Singleton instance = createInst();
public static Singleton getInst() {
return instance ;
}
private static synchronized createInst() {
return new Singleton();
}
The Java language specification guarantees that static initiailzers will be run just once, when a class is loaded for the first time, and in a guaranteed thread-safe manner.