Skip to content
Sharp

Modern Java · interview question

How does an enum improve maintainability in Java applications?

Multiple choiceMediumchapter-7-curatedpremiummodern-javaenums
Choose one answer
Answer and explanation

Correct answer

D. By centralizing related constants with behavior.

Why

Enums improve maintainability by centralizing related constants and their behaviors, allowing changes to be made in one place. This reduces the risk of inconsistencies and errors in the application.

Test yourself on Modern Java

A free test with instant, explained results. No account needed.

Start free test
All Modern Java questions →