1.

Which property is shown most when upcasting is used?(a) Code reusability(b) Code efficiency(c) Complex code simple syntax(d) EncapsulationThis question was addressed to me in final exam.The query is from Upcasting in chapter Default Arguments vs Overloading, Upcasting and Downcasting of Object Oriented Programming

Answer»

Right option is (c) Complex code simple syntax

For explanation: The code WRITTEN USING upcasting mostly SHOWS complex code in simpler syntax FEATURES. This is because the upcasting concept can be applied as polymorphism and to group the similar type of OBJECTS.



Discussion

No Comment Found

Related InterviewSolutions