Page 1 of 1

Consider the following code. Which statement is correct? class x { protected void display() { Console.WriteLine("x"); 3

Posted: Fri Apr 29, 2022 7:07 am
by answerhappygod
Consider The Following Code Which Statement Is Correct Class X Protected Void Display Console Writeline X 3 1
Consider The Following Code Which Statement Is Correct Class X Protected Void Display Console Writeline X 3 1 (69.45 KiB) Viewed 25 times
Consider The Following Code Which Statement Is Correct Class X Protected Void Display Console Writeline X 3 2
Consider The Following Code Which Statement Is Correct Class X Protected Void Display Console Writeline X 3 2 (60.38 KiB) Viewed 25 times
Consider the following code. Which statement is correct? class x { protected void display() { Console.WriteLine("x"); 3 } class y: x { protected void show() { Console.WriteLine("y"); ] ] class Program { static void Main(string[] args) { y anObject = new y(); anObject.show(); Console.ReadKey(); ] } The output is x The output is y There is an error because method show() is not accessible in class program
Consider the following code. Which statement is correct? class x public x(int a) 1 Console.WriteLine("x"); class yox public y(int b) Console.WriteLine("y"); 1 class Program static void Main(string[] args) yanObject - new y(2); Console.ReadKey(); 1 1 The output is x The output isy There is an error because x does not a parameterless constructor