Advertisement
Guest User

sdasgree

a guest
Aug 22nd, 2011
972
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. /**
  2.  *
  3.  * @author Kamil
  4.  * Implementacja wzorca projektowego Singleton w języku JAVA
  5.  */
  6. public class Singleton {
  7.    
  8.     private static class SingletonHolder{
  9.         public static final Singleton instance = new Singleton();
  10.     }
  11.    
  12.     private Singleton(){
  13.        
  14.     }
  15.    
  16.     public static Singleton getInstance(){
  17.         return SingletonHolder.instance;
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement