An enumeration is a group of related constants, each of which is given a descriptive name.
Every enumerated value corresponds to a preset integer. In your code, however, you can
refer to an enumerated value by name, which makes your code clearer and helps prevent
errors. For example, it’s much more straightforward to set the border of a label to the enumerated
value BorderStyle.Dashed rather than the obscure numeric constant 3. In this
case, Dashed is a value in the BorderStyle enumeration, and it represents the number 3.
// Define enumaration type called enumType
Enum enumType
{
Admin; //Each value in the enum corresponding have a integer value Starting from 0 (zero)
Guest;
Anonymous;
}

0 comments:
Post a Comment