HashMap: Internal Implementation
Let's look at how HashMap works internally.
We'll cover the following...
How HashMap works internally is the most asked interview question in Java interviews. And the reason is that it is difficult to understand the inner workings of HashMap. In this lesson, we will try to understand every aspect of HashMap.
The basic principle used by a HashMap to store elements is Hashing. Hashing is a way to assign a unique code for any variable or object after applying any formula to its properties. The unique code is called HashCode.
Some of the properties of HashCode are:
- If two objects are equal, then they should