Bird
Raised Fist0

Which of the following statements about method overriding is INCORRECT?

medium🐞 Bug Identification Q14 of Q15
OOP & Design Patterns - Polymorphism - Compile-Time (Overloading) vs Runtime (Overriding)
Which of the following statements about method overriding is INCORRECT?
AOverriding methods must have the same method signature as the method in the superclass
BA subclass can call the superclass's overridden method using a special keyword
COverriding enables runtime polymorphism through dynamic dispatch
DOverriding is resolved at compile time by the compiler
Step-by-Step Solution
  1. Step 1: Review overriding rules

    Overriding requires the same method signature and enables runtime polymorphism.
  2. Step 2: Analyze each statement

    Overriding methods must have the same method signature as the method in the superclass is correct; signatures must match. Overriding enables runtime polymorphism through dynamic dispatch is correct; overriding uses dynamic dispatch. A subclass can call the superclass's overridden method using a special keyword is correct; subclasses can call superclass methods (e.g., via super keyword).
  3. Step 3: Identify incorrect statement

    Overriding is resolved at compile time by the compiler is incorrect because overriding is resolved at runtime, not compile time.
  4. Final Answer:

    Option D -> Option D
  5. Quick Check:

    Overriding is a runtime mechanism, not compile-time.
Quick Trick: Overriding = runtime binding, not compile-time
Common Mistakes:
MISTAKES
  • Believing overriding is compile-time resolved
  • Confusing signature requirements with overloading
  • Ignoring ability to call superclass methods
Trap Explanation:
PITFALL
  • Option B is a common misconception; candidates often confuse overriding with overloading compile-time resolution.
Interviewer Note:
CONTEXT
  • Checks candidate's ability to spot subtle misconceptions about overriding mechanics.
Master "Polymorphism - Compile-Time (Overloading) vs Runtime (Overriding)" in OOP & Design Patterns

2 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More OOP & Design Patterns Quizzes