1.

Which way the downcasting is possible with respect to inheritance?(a) Upward the inheritance order(b) Downward the inheritance order(c) Either upward or downward the inheritance order(d) Order of inheritance doesn’t matterI have been asked this question in homework.I'd like to ask this question from Downcasting in chapter Default Arguments vs Overloading, Upcasting and Downcasting of Object Oriented Programming

Answer»

Right choice is (b) DOWNWARD the inheritance order

Best explanation: The downcasting is always downward the inheritance order. Since the BASE class object have to be casted into derived class TYPE. This is a BASIC DEFINITION of downcasting.



Discussion

No Comment Found

Related InterviewSolutions