• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Integer Wrappers Comparison doubt

 
Harsha Subbarayappa
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Can anyone please explain why it prints

i1 i2 not equal
i3 i4 both equal

Thanks.

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

<edit>corrected syntex</edit>
 
Harsha Subbarayappa
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it...

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

Thanks you very much.
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic