Which two are benefits of polymorphism?
A. Faster code at runtime
B. More efficient code at runtime
C. More dynamic code at runtime
D. More flexible and reusable code
E. Code that is protected from extension by other classes
Which two are benefits of polymorphism?
A. Faster code at runtime
B. More efficient code at runtime
C. More dynamic code at runtime
D. More flexible and reusable code
E. Code that is protected from extension by other classes
CD
I would definitely go for C and D, polymorphism is not directly related to efficiency but rather to dynamism and flexibility
It helps programmers reuse the code and classes once written, tested and implemented. They can be reused in many ways.
Single variable name can be used to store variables of multiple data types(Float, double, Long, Int etc).
Polymorphism helps in reducing the coupling between different functionalities.