1.

Which among the following is true for upcasting in inheritance?(a) Downward to the inheritance tree(b) Upward to the inheritance tree(c) Either upward or downward(d) Doesn’t apply on inheritanceThe question was posed to me in quiz.My question comes from Upcasting in division Default Arguments vs Overloading, Upcasting and Downcasting of Object Oriented Programming

Answer»

Right answer is (b) UPWARD to the INHERITANCE tree

For explanation: The upcasting concept in inheritance is ALWAYS APPLIED upward the inheritance tree. The derived class objects can be type casted to any of its parent class type. Since is a relationship APPLIES in general inheritance.



Discussion

No Comment Found

Related InterviewSolutions