• Post Reply Bookmark Topic Watch Topic
  • New Topic

obj.equals()  RSS feed

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
difference between object.equals() and ==
any article link is appreciated
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.jguru.com/faq/view.jsp?EID=13549 , can be useful
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see basically equals is a method.. so you can override that in your class because all classes in java are implicitly extended from the class Object. where equals is a method available in Object class.

and more over since u can define the body of equals method.. u can say that method to check the content of the string. where as if you give == it checks the reference. this is the main difference..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!