Last active
September 4, 2018 10:13
-
-
Save ShwetaChauhan18/eb7f73fc84a9d077779e7e2a132e67ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ThreadSafeSingleton { | |
private static ThreadSafeSingleton mThreadSafeSigleton; | |
private ThreadSafeSingleton(){} | |
public static synchronized ThreadSafeSingleton getThreadSafeSingleton(){ | |
if(mThreadSafeSigleton == null){ | |
mThreadSafeSigleton = new ThreadSafeSingleton(); | |
} | |
return mThreadSafeSigleton; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment