Access Parent class method using child class object
Hi,
I have a scenario as given below.
Class A
{
public void method()
{
Console.WriteLine("A");
}
}
Class B :A
{
public void method()
{
Console.WriteLine("B");
}
}
Here in main method of a class, I create an object for Class B and I want to access method() of Class A.
i.e B b = new B(); Using this 'b' object I want to access the method() of Class A.
I am unable to do this please give me the solution