🎯 1. What is an Enum?

Enum = a special data type used to define a fixed set of constants.

Example:

DAYS, COLORS, STATUS, ROLES, PAYMENT TYPES, DIRECTIONS, etc.

Enums prevent:

❌ invalid values

❌ typos

❌ random strings spreading everywhere


2. Why Enums?

✔ Type-safe constants

✔ No duplicate values

✔ Clean, readable code

✔ Replaces constants like STATIC FINAL values

✔ Used everywhere in real projects (Spring Boot, JPA, APIs)


🧱 3. Creating an Enum

enum Day {
    MONDAY, TUESDAY, WEDNESDAY, THURSDAY,
    FRIDAY, SATURDAY, SUNDAY
}

Usage: