The answer is NO . Making keys in any hashing data structure will cause memory leak. If we make the keys mutable then the hashcode() of the key will no more be consistent over time which will cause lookup failure for that object from the data structure.3 Ağu 2019