2
Reply

What is an Enum in C#?

Sanjay Dixit

Sanjay Dixit

Jun 11, 2013
1.2k
0

    In C#, enum is a value type data type. The enum is used to declare a list of named integer constants. It can be defined using the enum keyword directly inside a namespace, class, or structure. The enum is used to give a name to each constant so that the constant integer can be referred using its name. Example: enum WeekDays {Monday = 0,Tuesday =1,Wednesday = 2,Thursday = 3,Friday = 4,Saturday =5,Sunday = 6 }Console.WriteLine(WeekDays.Friday); Console.WriteLine((int)WeekDays.Friday);

    Samatha Reddy
    March 16, 2017
    0

    Enum in C# is reference type. Enum is a distinct type that consists of a set of named constants called the enumerator list.

    Sasi Kala
    December 03, 2013
    0