🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Inheritance and Polymorphism: all 10 questions

Quiz: Inheritance and Polymorphism · Question 10 of 10

You write @Override on a method but misspell its name. What happens?

You write @Override on a method but misspell its name. What happens?

  1. A.It silently becomes a new method
  2. B.It runs the parent's method instead
  3. C.Compile error: the method does not override anything
  4. D.A warning appears only at run time
Answer & explanation

Correct answer: Compile error: the method does not override anything

@Override asks the compiler to confirm that a parent method with the same signature exists, which catches typos and wrong parameters.

Can you get the rest right without peeking?

Take the timed Quiz: Inheritance and Polymorphism quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →