In HashMap, only one null key is allowed. If key of the HashMap is null then it will always be present in the index 0. NullPointerException is thrown if you try to call hashCode() method on null key.
As a result, when a get() method is called then value of the first index is returned.







Leave a comment