Can you override equals method?

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 difference between equals () and compare to ()?

Leave a Reply

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