Created
September 21, 2015 04:27
-
-
Save choiseungho/73412bab756d35d86004 to your computer and use it in GitHub Desktop.
정적 팩토리를 이용한 Singleton
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
package com.tistory.seungdols.effetive.ex_1; | |
/** | |
* @PROJECT effectiveJava | |
* @PACKAGE com.tistory.seungdols.effetive.ex_1 | |
* @WRITTER Administrator | |
* @DATE 2015-09-21 | |
* @HISTORY | |
* @DISCRIPT | |
*/ | |
public class SingletonPattern { | |
//정적 팩토리를 이용한 Singleton | |
private static final SingletonPattern INSTANCE = new SingletonPattern(); | |
private SingletonPattern(){} | |
public static SingletonPattern getInstance() | |
{ | |
return INSTANCE; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment