Concept Flow - Why enums constrain values
Define enum with fixed values
Create variable of enum type
Assign only enum values allowed
Try to assign invalid value?
Yes→Compile error
No
Program continues
Enums define a fixed set of values. Variables of enum type can only hold these values. Trying to assign anything else causes an error.