Guest User

Untitled

a guest
Jul 21st, 2016
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.24 KB | None | 0 0
  1. public static synchronized Singleton getInstance() {
  2.     if (singletonInstance == null) {
  3.         synchronized (singletonInstance) {
  4.             if (singletonInstance == null) {
  5.                 singletonInstance = new Singleton();
  6.             }
  7.         }
  8.     }
  9.     return singletonInstance;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment