Java SE 8 Programmer I — Question 76
Which two are benefits of polymorphism? (Choose two.)
Answer options
- 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
Correct answer: B, D
Explanation
Option B is correct because polymorphism allows for more efficient code execution as it can handle multiple types dynamically. Option D is also correct as polymorphism enhances code flexibility and reusability by enabling the same interface to be used for different underlying forms. The other options, A, C, and E, do not accurately reflect the benefits of polymorphism.