• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

equals method

 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i remember someone showed me the full implementation of the equals method....can i get it again? anyone....
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually the question was about StringBuffer's equals method....something like that...maybe it was in the scjplinks....
 
Henry Wong
author
Marshal
Pie
Posts: 21024
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The StringBuffer class does not override the equals() method. It inherits it from the Object class.

Henry
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know it doesnt...there was a article that i read when we invoke equals on stringbuffers....true is returned only when both the objects are same.....someone showed me the whole code of equals method....something like

public boolean equals(Object 0)
{
//some code
}
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With the information provided by Henry, it should be easy to find the source code of Object class on java.lang.Object source code, like this is the first result...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic