during the reading of Java documentation I found one interesting thing about the collections. Wrapper classes do not override equals method. So it sepouseto mean that it's impossible to use them as a keys to map. I found this interesting because I use wrappers before and thay seems work fine. So I wrote simple test code:
Mohamed Sanaulla wrote:If you happened to check the source of the Integer.java wrapper class, you can find that the equals method has been overridden to check that both the Integer objects have same int value.
Yes, you are right. After posting this topic I go to source code and found this line"
It was mistake in the book i reading now and a mistake in my code. Double mistake confused me.