File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Wrapper class

 
santhosh.R gowda
Ranch Hand
Posts: 296
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends
please tell the the difference between == and equals method in wrapper class... For example Integer i1 = 10;Integer i2 =10:
System.out.println(i1==i2) will evaluates true and i1.equals(i2) will also evaluates true..... but in another example Integer i1 = 1000;Integer i2 =1000:
System.out.println(i1==i2) will evaluates false and i1.equals(i2) will evaluates true. tell me how exactly == and equals work in wrapper class .the == evaluates true upto 127 why is it so....?

[MG Edited to take out the confusing smilies in the subject line]
 
Maverick Uta
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Explanation by Jesper Young in the below post, should answer your question..

http://www.coderanch.com/t/436721/Java-General-beginner/java/operators-with-Wrapper-class
 
Chiranjeevi Kanthraj
Ranch Hand
Posts: 290
Hibernate Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya its correct
 
santhosh.R gowda
Ranch Hand
Posts: 296
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jesper Young now i got the point .......
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic