Skip to content

Instantly share code, notes, and snippets.

@prashant4224
Created May 28, 2020 17:29
Show Gist options
  • Save prashant4224/fa87b7ae95328e65c59f1861b8268250 to your computer and use it in GitHub Desktop.
Save prashant4224/fa87b7ae95328e65c59f1861b8268250 to your computer and use it in GitHub Desktop.
/* 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