public void TestLongerInheritance() { MyFunctionality instFunctionality = new DerivedMyFunctionality(); IFunctionality instInterface = instFunctionality; instFunctionality.Method(); instInterface.Method(); }
public void TestInheritance() { MyFunctionality instDerived = new MyFunctionality(); DefaultFunctionality instBase = instDerived; IFunctionality instInterface = instDerived; Console.WriteLine("Type is (" + instInterface.GetIdentifier() + ")"); Console.WriteLine("Calling the interface"); instInterface.Method(); Console.WriteLine("Calling the derived"); instDerived.Method(); Console.WriteLine("Calling the base class"); instBase.Method(); }