Last active
August 29, 2015 14:08
-
-
Save jaspercastillo/a70205f6313549848175 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
package com.quillbytes.scratch.singletons; | |
import static java.lang.System.out; | |
public class SingletonEnumTest { | |
// or have this in a separate file SingletonEnum.java | |
enum SingletonEnum { | |
INSTANCE; | |
private SingletonEnum() { | |
out.println("SingletonEnum instantiated!"); | |
} | |
} | |
public static void main(String... args) { | |
Class<SingletonEnum> c = SingletonEnum.class; | |
//SingletonEnum x = SingletonEnum.INSTANCE; | |
out.println("end of main"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment