Hi ,
I have the following doubt in the singleton pattern.
Kindly ignore the typing errors in the above code.The point at issue is, if we write the code as I did above, it results in double-checked locking.
So, if I change the code as shown below, would it be correct & free from double-checked locking?
Second,how to implement the singleton in a distributed environment(more than one jvm) so that there is only one instance of Singleton class.
Thanks.