

MCQOPTIONS
Saved Bookmarks
1. |
Which of the following statements are correct about the C#.NET code snippet given below? namespace IndiabixConsoleApplication ( class Sample { private enum color : int { red, green, blue } public void fun() { Console.WriteLine(color.red); } } class Program { static void Main(string[ ] args) { // Use enum color here } } } To define a variable of type enum color in Main(), we should use the statement, color c; . enum color being private it cannot be used in Main(). We must declare enum color as public to be able to use it outside the class Sample. To define a variable of type enum color in Main(), we should use the statement, Sample.color c; . We must declare private enum color outside the class to be able to use it in Main(). |
A. | 1, 2, 3 |
B. | 2, 3, 4 |
C. | 3, 4 |
D. | 4, 5 |
Answer» C. 3, 4 | |