1.

Which among doesn’t illustrates polymorphism?(a) Function overloading(b) Function overriding(c) Operator overloading(d) Virtual functionThe question was posed to me in exam.Origin of the question is OOPs Features topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

Correct ANSWER is (B) Function overriding

Easy explanation - Function overriding doesn’t illustrate polymorphism because the FUNCTIONS are actually different and theirs scopes are different. Function and operator overloading illustrate proper polymorphism. VIRTUAL functions show polymorphism because all the CLASSES which inherit virtual function, define the same function in different ways.



Discussion

No Comment Found

Related InterviewSolutions