Can we create HashMap key immutable or mutable will be better?

Both hashcode and equals method are used in put and get method of HashMap. You need to make sure you can always get the value object from the map after you put it with the key object. No matter you change the key object or not. But Immutable object is good enough to achieve that .26 Kas 2013

Sizin İçin Seçtik  Is Chromia a metaverse coin?

Leave a Reply

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