1. Which of the following is the correct output for the C#.NET code snippet given below? enum color { red, green, blue } color c = color.red; Type t; t = c.GetType(); string[ ]str; str = Enum.GetNames(t); Console.WriteLine(str[ 0 ]);






Write Comment

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

Tags
Show Similar Question And Answers
QA->A jar contains 10 red marbles and 30 green ones.How many red marbles must be added to the jar so that 60% of the marbles will be red?....
QA->As per Co-operative societies rule ‘Net profit’ means net profit as certified by :....
QA->Which chemical compound is also known in the names of "Prussian blue, Parisian Blue & Berlin Blue"?....
QA->Twice World Cup Football winners Argentina sacked their coach on April 10, 2017 after a string of poor results. ? Name that coach?....
QA->Which is not correct as regards to an open type combustion chamber?....
MCQ->What is the output of the C#.NET code snippet given below? namespace IndiabixConsoleApplication { public enum color { red, green, blue }; class SampleProgram { static void Main (string[ ] args) { color c = color.blue; switch (c) { case color.red: Console.WriteLine(color.red); break; case color.green: Console.WriteLine(color.green); break; case color.blue: Console.WriteLine(color.blue); break; } } } }....
MCQ->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().....
MCQ->Which of the following is the correct output for the C#.NET code snippet given below? enum color { red, green, blue } color c = color.red; Type t; t = c.GetType(); string[ ]str; str = Enum.GetNames(t); Console.WriteLine(str[ 0 ]);....
MCQ->Which of the following will be the correct output for the C#.NET code snippet given below? enum color : int { red = -3, green, blue } Console.Write( (int) color.red + ", "); Console.Write( (int) color.green + ", "); Console.Write( (int) color.blue );....
MCQ->What will be the output of the C#.NET code snippet given below? namespace IndiabixConsoleApplication { class SampleProgram { static void Main(string[ ] args) { string str= "Hello World!"; Console.WriteLine( String.Compare(str, "Hello World?" ).GetType() ); } } }....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use
DMCA.com Protection Status Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions