Skip to content

Instantly share code, notes, and snippets.

@vitorvezani
Created March 28, 2016 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vitorvezani/43fc7feb36adf3991cde to your computer and use it in GitHub Desktop.
Save vitorvezani/43fc7feb36adf3991cde to your computer and use it in GitHub Desktop.
Enum Singleton
public enum EnumSingleton {
INSTANCE;
private final String[] favoriteSongs = { "Hound Dog", "Heartbreak Hotel" };
public void printFavorites() {
System.out.println(Arrays.toString(favoriteSongs));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment