1.

Upcasting is _____________________ without an explicit type cast.(a) Always allowed for public inheritance(b) Always allowed for protected inheritance(c) Always allowed for private inheritance(d) Not allowedI got this question in a national level competition.I'm obligated to ask this question of Upcasting topic in section Default Arguments vs Overloading, Upcasting and Downcasting of Object Oriented Programming

Answer»

Right ANSWER is (a) ALWAYS allowed for public inheritance

The best EXPLANATION: The public inheritance shows the most flexible is-a relationship. Hence explicit TYPE casting is not required. Implicit type casting is DONE by the compiler.



Discussion

No Comment Found

Related InterviewSolutions