Bird
0
0

Which of the following is NOT true about method overriding in Java?

easy📝 Conceptual Q2 of 15
Java - Inheritance

Which of the following is NOT true about method overriding in Java?

AThe access level of the overriding method can be more restrictive
BThe method signature must be the same in both superclass and subclass
CThe return type must be the same or a subtype (covariant) of the superclass method
DThe overriding method can throw fewer or narrower checked exceptions
Step-by-Step Solution
Solution:
  1. Step 1: Review access level rules in overriding

    The overriding method cannot have a more restrictive access level than the overridden method.
  2. Step 2: Check other statements

    Method signature must match, return type can be covariant, and exceptions can be narrower or fewer.
  3. Final Answer:

    The access level of the overriding method can be more restrictive -> Option A
  4. Quick Check:

    Access level cannot be more restrictive [OK]
Quick Trick: Overriding method access ≥ superclass method access [OK]
Common Mistakes:
  • Allowing private overriding methods
  • Ignoring exception narrowing rules
  • Confusing method signature with return type

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Java Quizzes