Created
March 1, 2010 07:58
-
-
Save TonnyXu/318182 to your computer and use it in GitHub Desktop.
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
public final class Singleton3{ | |
private static class Handler{ | |
private static final Singleton3 INSTANCE = new Singleton3(); | |
} | |
private Singleton3(){ | |
if (null != Handler.INSTANCE){ | |
throw new IllegalArgumentException("Already instantiated."); | |
} | |
} | |
public static final Singleton3 getInstance(){ | |
return Handler.INSTANCE; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment