wood burning stoves 2.0*
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "equals method" Watch "equals method" New topic
Author

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
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

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

Henry


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
Sheriff

Joined: Aug 03, 2008
Posts: 9305
    
  17

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: equals method