Given 2 types
class A { public virtual void Hello() { Console.WriteLine("A"); } } class B : A { public override void Hello() { Console.WriteLine("B"); } }
and an instance of 'B' B b = new B();
Can I access the Hello() A thru b method? (I can think of exposing property A as in B, but not sure if there is another way)
I knew this was possible in C ++ , but it scratched my head in C #.
PS : Please, no talk around: "Why do you want this?" or "it's a bad design," etc.
source share