1.

Which of the following best describes polymorphism?(a) Ability of a class to derive members of another class as a part of its own definition(b) Means of bundling instance variables and methods in order to restrict access to certain class members(c) Focuses on variables and passing of variables to functions(d) Allows for objects of different types and behaviour to be treated as the same general typeThis question was posed to me in homework.My question is based upon Polymorphism topic in section Classes and Objects, Inheritance, Polymorphism, Encapsulation and Exception Handling of Python

Answer»

Right option is (d) Allows for OBJECTS of different TYPES and behaviour to be treated as the same general type

For EXPLANATION: Polymorphism is a feature of object-oriented programming languages. It allows for the implementation of elegant software that is well designed and EASILY MODIFIED.



Discussion

No Comment Found

Related InterviewSolutions