Sanjay Dixit
What is an Enum in C#?
By Sanjay Dixit in C# on Jun 11 2013
  • Samatha Reddy
    Mar, 2017 16

    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);

    • 0
  • Sasi Kala
    Dec, 2013 3

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

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS