SHARE
TWEET

Untitled

a guest Jan 12th, 2017 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Something {
  2.     private Something() {}
  3.  
  4.     private static class LazyHolder {
  5.         private static final Something INSTANCE = new Something();
  6.     }
  7.  
  8.     public static Something getInstance() {
  9.         return LazyHolder.INSTANCE;
  10.     }
  11. }
  12.    
  13. public class Something {
  14.         private Something() {}
  15.  
  16.         private static final Something INSTANCE = new Something();
  17.  
  18.         public static Something getInstance() {
  19.             return INSTANCE;
  20.         }
  21.     }
RAW Paste Data
Top