Bird
0
0

Which of the following statements about method overriding in Java is correct?

hard📝 Conceptual Q10 of 15
Java - Polymorphism
Which of the following statements about method overriding in Java is correct?
AStatic methods can be overridden
BOverriding methods must have the same or narrower access modifier
COverriding methods can throw new checked exceptions not declared in the parent method
DReturn type of overriding method can be a subtype of the original method's return type
Step-by-Step Solution
Solution:
  1. Step 1: Review exception rules in overriding

    Overriding methods cannot throw new or broader checked exceptions.
  2. Step 2: Review access modifier rules

    Overriding method must have same or wider (not narrower) access.
  3. Step 3: Review return type and static method rules

    Return type can be subtype (covariant). Static methods cannot be overridden, only hidden.
  4. Final Answer:

    Return type of overriding method can be a subtype of the original method's return type -> Option D
  5. Quick Check:

    Covariant return types allowed in overriding = A [OK]
Quick Trick: Overriding allows covariant return types, not new checked exceptions [OK]
Common Mistakes:
  • Thinking new checked exceptions allowed
  • Assuming narrower access modifier allowed
  • Confusing static method hiding with overriding

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Java Quizzes