wood burning stoves*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes equals method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "equals method" Watch "equals method" New topic

equals method

Ankur kothari
Ranch Hand

Joined: Sep 06, 2009
Posts: 531
i remember someone showed me the full implementation of the equals method....can i get it again? anyone....
Ankur kothari
Ranch Hand

Joined: Sep 06, 2009
Posts: 531
actually the question was about StringBuffer's equals method....something like that...maybe it was in the scjplinks....
Henry Wong

Joined: Sep 28, 2004
Posts: 18509

The StringBuffer class does not override the equals() method. It inherits it from the Object class.


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Ankur kothari
Ranch Hand

Joined: Sep 06, 2009
Posts: 531
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

Joined: Aug 03, 2008
Posts: 9291

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...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Don't get me started about those stupid light bulbs.
subject: equals method
Similar Threads
Difference in equals() method and comparision operator
I defined an equals method, but Hashtable ignores it. Why?
util package
HashCode Call