Question

Select the statement which should be added to the current set of 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); (Correct Answer)
  • console.writeline(base.a + ” ” + a);

Answer is "console.writeline(a + ” ” + base.a);"

2 Answer and explanations

You don't need to login to post your comment
172
Priya

does anyone know the correct answer

108
Rashmi

how did the answer came

Post your answer

You don't need to login to post answer






Ask Question


Note: Options are optional, you can leave them blank