Java / Map and its implementations
Difference between HashMap and IdentityHashMap.
|HashMap uses equals method to compare keys.||IdentityHashMap uses == operator to compare its keys.|
|HashMap uses || IdentityHashMap uses |
|HashMap may not be faster when compared to IdentityHashMap as it uses equals method for key comparison.||IdentityHashMap may be faster than HashMap as it doesn't use equals method..|
|HashMap keys need to be immutable.||IdentityHashMap doesn't require the key object to be immutable as it doesn't use hashcode or equals method.|
More Related questions...