What will be the correct statement of the following C# code?
enum color:byte
{
yellow = 500,
green = 1000,
pink = 1300
}
enum color:byte
{
yellow = 500,
green = 1000,
pink = 1300
}A. byte value cannot be assigned to enum elements
B. enum elements should always take successive values
C. enum must always be of int type
D. When the valid range of byte exceeds, the compiler will report an error
Answer: Option D
Related Questions on Classes and Objects in C Sharp
A. A blueprint for creating objects
B. A method in C#
C. A variable in C#
D. A data type in C#
A. A method in C#
B. A variable in C#
C. An instance of a class
D. A data type in C#
A. public
B. private
C. protected
D. internal

Join The Discussion