Created
March 28, 2016 18:51
-
-
Save vitorvezani/43fc7feb36adf3991cde to your computer and use it in GitHub Desktop.
Enum 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
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