What's the use of "enum" in Java?
In Java, the enum keyword is used to define a fixed set of constants, making your code more readable, maintainable, and type-safe. But why use enum instead of traditional constants like static final variables? Here’s why enum is so useful: Type safety: Unlike plain constants, enums prevent invalid values from being…
Answered May 20, 2025 · 695 Views Read answer →