Can we override the equals () method in Java?

You can override the equals method on a record, if you want a behavior other than the default . But if you do override equals , be sure to override hashCode for consistent logic, as you would for a conventional Java class.18 Kas 2011

Sizin İçin Seçtik  What is the difference between == and === while comparing objects?

Leave a Reply

Your email address will not be published. Required fields are marked *