Loading…
Loading…
Ten exam-style questions on simple and complex enums, values(), valueOf(), ordinal(), enums in switch including Java 21 qualified case labels, private constructors, constant-specific bodies, abstract methods and interfaces, with explanations.
Practice questions for the article Java Enums: Values, Constructors, Fields, Methods and switch.
Remember that all enum constants are built once, together, the first time the enum is used. Aim for at least 8 out of 10.
Quiz path: step 45. Take the quizzes in this order, after reading each article.
Previous quiz: Interface default, static and private Methods (OCP 21)
Next quiz: Sealed Classes and Interfaces (OCP 21)
10 questions · pass at 68%
Check your understanding; you see the answers and explanations after submitting.
Discussion
Sign in to ask a question or share what you learned.