Qus:    What is enum? What is the default data type of enum?
Nov 27, 2020 19:45 DotNet 2 Answers Views: 263 FRAUSKY

 



 An enumeration (enum) is a set of named integer constants. An enumerated type is declared using the enum keyword. C# enumerations are value data type. In other words, enumeration contains its own values and cannot inherit or cannot pass inheritance.



The default type of the enumeration elements is int. By default, the first enumerator has the value 0, and the value of each successive enumerator is increased by 1.

Prev Next
Answers (2)
PARTH Nov 28, 2020 08:35
Answer:   An enumeration (enum) is a set of named integer constants. An enumerated type is declared using the enum keyword. C# enumerations are value data type. In other words, enumeration contains its own values and cannot inherit or cannot pass inheritance.

The default type of the enumeration elements is int. By default, the first enumerator has the value 0, and the value of each successive enumerator is increased by 1.

NAIDU Nov 28, 2020 15:53
Answer:   Enum is a value type. Enum is a collection of constants which means it is a collection of string constants which are representing collection of integer constants. Int is the default data type of enum.

Post Your Answer
Guest User

Not sure whare to join tuition right for you?

Choose the right one for you.
Get the help of the experts and find a solution that best suits your needs.


Let`s Connect