aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Integer Wrappers Comparison doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Integer Wrappers Comparison doubt" Watch "Integer Wrappers Comparison doubt" New topic
Author

Integer Wrappers Comparison doubt

Harsha Subbarayappa
Greenhorn

Joined: Oct 19, 2010
Posts: 5
Hi Can anyone please explain why it prints

i1 i2 not equal
i3 i4 both equal

Thanks.

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575


try above. by the way : do you know about IntegerCache?

<edit>corrected syntex</edit>
Harsha Subbarayappa
Greenhorn

Joined: Oct 19, 2010
Posts: 5
Got it...

http://www.owasp.org/index.php/Java_gotchas

Thanks you very much.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Harsha please UseCodeTags when posting code. It will highlight your code and make it much easier to read. It probably will also increase the number of people helping you. I will add them for you this time so that you can see the difference.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Integer Wrappers Comparison doubt
 
Similar Threads
how is this possible please explain
Boxing, == and equals
Small doubt in Boxing & == & equals()
== and != for Wrapper Objects
how is this possible please explain