Vidyalelo
C# Programming · Q223

Classes and Objects in C Sharp

Programming · C# Programming · question 223

Q223

Select the statement which should be added to the current C# code to get the output as 10 20? class baseclass protected int a = 20; class derived : baseclass int a = 10; public void math() /* add code here */

A.
Console.writeline( a + " " + this.a);
B.
Console.Writeline( mybase.a + " " + a);
C.
console.writeline(a + " " + base.a);
Answer
D.
console.writeline(base.a + " " + a);

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board