Enums

The class GameApp demonstrates the real benefit of all this enum business. Because the variable gameLevel (defined in class Game) is of type Level, you can assign only one of the constants defined in the enum Level—that is, Level.BEGINNER, Level.INTERMEDIATE, or Level.EXPERT.

Last updated