I am just trying to understand if the below is possible.
I have customer, specialCustomer and goldCustomer classes. Special inherits from Customer and GoldCustomer inherits from SpecialCustomer.
How can i access Customer class's implementation of Add() from GoldCustomer? Using base.Add() calls only the immediate parent's Add()
public class Customer
{
public virtual void add()
{
Console.WriteLine("Base Add");
}
}
public class SpecialCustomer: Customer
{
public override void add()
{
Console.WriteLine("SPL CUST Add");
}
}
public class GoldCustomer : SpecialCustomer
{
public new void add()
{
base.add();// cals the immediate parent.
//How to call the method on Customer base class(Parent's parent)
Console.WriteLine(" chid GOLD CUST Add");
}
}