Java / Map and its implementations
Explain rehashing process in Java HashMap.
If the number of elements in the map exceeds a given threshold defined by load-factor (default .75) it will re-size the map once it is 75% occupied.
Java HashMap re-size itself by creating a new bucket array of it's size twice of the previous size of HashMap and puts every old element into that new bucket array. This process is termed as rehashing because it also applies the hash function to find new bucket location.
More Related questions...