Java Enums: Fields, Methods and Constructors (1Z0-831)
A Java enum is a class whose instances are a fixed set of named constants, declared in the enum itself, and which can carry fields, constructors and methods like any other class. This lesson covers objective 3.7 of the Java SE 25 Developer exam (1Z0-831): how an enum body is laid out, the rules for enum constructors, when constants are constructed and why constructors cannot use the enum's static fields, the built-in methods values(), valueOf(), ordinal(), name() and toString(), comparing and sorting constants, constant-specific bodies, enums that implement interfaces, and how enums behave in switch.
You’ve read your 2 free 1Z0-831 lessons
Sign up free to read 48 more lessons — your progress is saved.
Source
This lesson covers the "Applying Object-Oriented Principles in Java Programs" domain of the official 1Z0-831 exam guide. Vendors revise their guides — check the source for the current version.
- Java SE 25 Developer Professional (1Z0-831) exam page and topics — Oracle University
Sign up free to mark lessons complete, bookmark topics and track your exam readiness.