1.

When are the pointer types known for upcasting the objects?(a) Compile time(b) Runtime(c) Source code build time(d) Doesn’t apply to pointer typesThis question was addressed to me by my school teacher while I was bunking the class.My doubt is from Upcasting in division Default Arguments vs Overloading, Upcasting and Downcasting of Object Oriented Programming

Answer»

The CORRECT option is (a) Compile time

Best explanation: The pointer or REFERENCE types are known at compile time for the upcasting of an object. This is because the ADDRESSES must be known for CASTING the derived CLASS to base class object.



Discussion

No Comment Found

Related InterviewSolutions