1. | Which of the following statements are correct about an enum used in C#.NET? 1 An enum can be declared inside a class. 2 An enum can take Single, Double or Decimal values. 3 An enum can be declared outside a class. 4 An enum can be declared inside/outside a namespace. 5 An object can be assigned to an enum variable.
|
|||||||
Answer: Option A Explanation: No answer description available for this question. Let us discuss.
|
2. | Which of the following statements is correct about an enum used in C#.NET? |
|||||||||
Answer: Option B Explanation: No answer description available for this question. Let us discuss.
|
3. | Which of the following statements are correct about the C#.NET code snippet given below? namespace IndiabixConsoleApplication 1 To define a variable of type enum color in Main(), we should use the statement, color c; . 2 enum color being private it cannot be used in Main(). 3 We must declare enum color as public to be able to use it outside the class Sample. 4 To define a variable of type enum color in Main(), we should use the statement, Sample.color c; . 5 We must declare private enum color outside the class to be able to use it in Main(). |
|||||||
Answer: Option B Explanation: No answer description available for this question. Let us discuss.
|
4. | Which of the following is the correct output for the C#.NET code snippet given below? enum color |
|||||||||
Answer: Option A Explanation: No answer description available for this question. Let us discuss.
|
5. | Which of the following statements is correct about the C#.NET code snippet given below? enum color : byte |
|||||||||
Answer: Option C Explanation: No answer description available for this question. Let us discuss.
|
6. | Which of the following statements are correct about enum used in C#.NET? 1 Every enum is derived from an Object class. 2 Every enum is a value type. 3 There does not exist a way to print an element of an enum as a string. 4 Every enum is a reference type. 5 The default underlying datatype of an enum is int. |
|||||||
Answer: Option A Explanation: No answer description available for this question. Let us discuss.
|
7. | Which of the following CANNOT be used as an underlying datatype for an enum in C#.NET? |
|||||||
Answer: Option C Explanation: No answer description available for this question. Let us discuss.
|
8. | An enum can be declared inside a class, struct, namespace or interface. |
|||
Answer: Option A Explanation: No answer description available for this question. Let us discuss.
|