codecentric (Serbia) Interview Question: When you are writing equals()... | Glassdoor

Interview Question

IT Consultant Interview Novi Sad (Serbia)

When you are writing equals() method, which other method or

  methods you need to override(Java)?
Answer

Interview Answer

1 Answer

0

"hashcode" is the right answer. Since equals and hashCode have are directly dependent on each other, so overriding one and not other will break their functionality.

Interview Candidate on Sep 11, 2016

Add Answers or Comments

To comment on this, Sign In or Sign Up.