Originally posted by Shyam Sunder V R: Hi ieveryone, I was going through teh K& B SCJP exam guide .....In the third chapter(Assignments) the section about Wrapper classes quoted something like this.....
It was said that the output would be same objs equal objs since to save memory two wrapper instances with same primitive always satisfy ==
but when I tried out i got the output as equal objs
can you elucidate why it is so?
P.S : i also tried out this code(since the int range is -128 to 127) the result is same.......
[ August 21, 2008: Message edited by: Shyam Sunder V R ]
Hey, did you read the code properly? You initialised a new object using the keyword new There is a difference between
Now I hope you will get the point when you read the book again.
Preparing for SCJP 6.0
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com