A Beginner’s Guide to Java Enums

An Enum in Java is a special data type that encompasses a set of predefined constants. When setting a variable of that Enum type, you have to use one of the constants that you define for it. A great example is the compass: In the above example, we create a new enum and it’s predefined […]