Bird
0
0

What is the main benefit of using runtime polymorphism in Java?

easy📝 Conceptual Q1 of 15
Java - Polymorphism
What is the main benefit of using runtime polymorphism in Java?
AIt increases the size of the compiled code.
BIt improves compile-time type checking.
CIt prevents method overriding.
DIt allows a program to decide which method to call at runtime.
Step-by-Step Solution
Solution:
  1. Step 1: Understand runtime polymorphism concept

    Runtime polymorphism means the program decides which overridden method to call during execution, not at compile time.
  2. Step 2: Analyze options

    Only It allows a program to decide which method to call at runtime. correctly describes this behavior. Others are unrelated or incorrect.
  3. Final Answer:

    It allows a program to decide which method to call at runtime. -> Option D
  4. Quick Check:

    Runtime polymorphism = method call decided at runtime [OK]
Quick Trick: Runtime polymorphism chooses method at runtime, not compile time [OK]
Common Mistakes:
  • Confusing compile-time and runtime decisions
  • Thinking it prevents method overriding
  • Assuming it increases code size

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Java Quizzes