Advanced
Object-Oriented Programming Concepts
Q90 / 100
In languages supporting "generics" or "templates", how does this relate to OOP polymorphism?
Correct! Well done.
Incorrect.
The correct answer is A) Generics provide "parametric polymorphism", allowing classes and methods to operate on any type while preserving type safety, distinct from subtype polymorphism via inheritance
A
Correct Answer
Generics provide "parametric polymorphism", allowing classes and methods to operate on any type while preserving type safety, distinct from subtype polymorphism via inheritance
Explanation
Parametric polymorphism (generics/templates) lets code be written once and reused for many types with compile-time type checking, complementing (not replacing) subtype/inheritance-based polymorphism.
Progress
90/100