Programming Languages C# Objective
Mar 08, 2013

Which of the following statements is correct about the C#.NET code ?

enum color : byte

{

    red = 500,

    green = 1000,

    blue = 1500

}

Choose the correct answer:
A) byte values cannot be assigned to enum elements.
B) Since 500, 1000, 1500 exceed the valid range of byte compiler will report an error.
C) enum elements should always take successive values.
D) enum must always be of int type.
Detailed Explanation

Option B is the right answer.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback