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
Consider the following code. Which statement is correct? class x { protected void display() { Console.WriteLine("x"); 3
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Consider the following code. Which statement is correct? class x { protected void display() { Console.WriteLine("x"); 3
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!