Skip to content

Instantly share code, notes, and snippets.

@jaspercastillo
Last active August 29, 2015 14:08
Show Gist options
  • Save jaspercastillo/a70205f6313549848175 to your computer and use it in GitHub Desktop.
Save jaspercastillo/a70205f6313549848175 to your computer and use it in GitHub Desktop.
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