Skip to content

Instantly share code, notes, and snippets.

@ShwetaChauhan18
Last active September 4, 2018 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShwetaChauhan18/eb7f73fc84a9d077779e7e2a132e67ce to your computer and use it in GitHub Desktop.
Save ShwetaChauhan18/eb7f73fc84a9d077779e7e2a132e67ce to your computer and use it in GitHub Desktop.
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