15. |
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)
{
}
}
}
- 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().
|