Created
May 28, 2020 17:29
-
-
Save prashant4224/fa87b7ae95328e65c59f1861b8268250 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
/* Singleton class double checking */ | |
public class Technology { | |
private static final Technology instance; | |
private Technology() {} | |
public static synchronized Technology getInstatnce() { | |
if (instance == null) { | |
synchronized (Technology.class) { | |
if (instance == null) { | |
instance = new Technology(); | |
} | |
} | |
} | |
return instance; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment