Is HashMap key immutable?

Make HashMap key object immutable Immutability allows you to get same hash code every time, for a key object . So it actually solves most of the problems in one go. Also, this class must honor the hashCode() and equals() methods contract.25 Oca 2022

Sizin İçin Seçtik  How do you make an employee object a key in HashMap?

Leave a Reply

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