--%>

Briefly describe enumeration

Briefly describe enumeration?

E

Expert

Verified

Enumeration can be defined as the value type which contains of a set of named values. These values are constants and are known as enumerators. Enumeration type is declared using a keyword enum. Every enumerator in the enumeration is associated with the underlying type which is set, by default, on an enumerator? The example is as follows which creates the enumeration to store unlike mixture of fruits:
enum Fruits {Banana, orange ,Apple , Guava};

In the above example, the enumeration Fruits is created, where number 0 is related with Banana, number 1 is related to Orange, number 2 is associated with Apple, and number 3 is related with Guava. We can access the enumerators of the enumeration by these values.

   Related Questions in Software Engineering