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

Quiz: Polymorphism · Question 6 of 10

You meant to override equals(Object o) but wrote equals(Student s). What did you actually create?

You meant to override equals(Object o) but wrote equals(Student s). What did you actually create?

  1. A.An override
  2. B.An overload, a separate method with a different parameter type
  3. C.A compile error always
  4. D.A static method
Answer & explanation

Correct answer: An overload, a separate method with a different parameter type

Changing the parameter type creates an overload; @Override would catch the mistake.

Can you get the rest right without peeking?

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

Start the quiz →