Select The Statement Which Should Be Added To The Current C #361
Select the statement which should be added to the current C# code to get the output as 10 20?</p> <pre><code class="language-csharp" line="1"> class baseclass { protected int a = 20; } class derived : baseclass { int a = 10; public void math() { /* add code here */ } } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Object Oriented Concepts - Inheritance Implementation - Quiz No.1.
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 */ } }
Console.writeline( a + ” ” + this.a);
Console.Writeline( mybase.a + ” ” + a);
console.writeline(a + ” ” + base.a);
console.writeline(base.a + ” ” + a);