Java, Spring, Microservices, Interview, Coding.
the map gives me the last inserted entry. Why is that? Answer lies in, how hashCode() and equals() method are implemented for the key Class. Have a look at the hashCode() method of the class Key which always returns “5” and the equals() method which is always returning “true”. When a value is put