Here X has type A ut dynamic type B. The argument has static type A and dynamic type A and when this method gets invoked the argument That which is of dynamic type A, does not have the operations, all the fields and methods, of the class B And results in a run time, undefined behavior at run time. 