An enum is a data type that contains fixed set of constants . An enum is just like a class , with a fixed set of instances known at compile time. Advantages of enum: enum improves type safety at compile-time checking to avoid errors at run-time.
An enum is a data type that contains fixed set of constants . An enum is just like a class , with a fixed set of instances known at compile time. Advantages of enum: enum improves type safety at compile-time checking to avoid errors at run-time.