Examveda

What will be the Correct statement of the following C# code?
public class maths
{
    public int x;
    public virtual void a()
    {

    }

}
public class subject : maths
{
    new public void a()
    {

    }

}

A. The subject class version of a() method gets called using sample class reference which holds subject class object

B. subject class hides a() method of base class

C. The code replaces the subject class version of a() with its math class version

D. None of the mentioned

Answer: Option D


Join The Discussion

Related Questions on Classes and Objects in C Sharp