← 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?
- A.An override
- B.An overload, a separate method with a different parameter type
- C.A compile error always
- 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 →