Hi folks,
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:
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.
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.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.