namespace contest { class Program { static void Main(string[] args) { B b = new B(); } } class A { public A() { k(); } private void k() { Console.WriteLine(base.GetType().Name); } } class B : A { } }
Can someone tell me why it outputs "B" instead of "Object", doesn't base.GetType() get A's parent object therefore the root Object?
Thanks a lot