302.
class A { public virtual void X() { Console.WriteLine(" A:M "); } } class B : A { public override void X() { Console.WriteLine(" B:M "); } static void Main() { B obj_b = new A(); obj_b.X(); } } What is the result?
View Description
we cannot do upcasting. (i.e) By creating instance to dervie class and initializing with the base class