This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes stringubuffer equals method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "stringubuffer equals method" Watch "stringubuffer equals method" New topic
Author

stringubuffer equals method

Raju Champaklal
Ranch Hand

Joined: Dec 10, 2009
Posts: 521
why is the equals method not overridden in stringbuffer class...how do i check if two stringbuffer objects have the same content?

i think only way we can do is invoking toString() on the stringbuffer objects and then calling equals on them


scjp 1.6 91%, preparing for scmad
"Time to get MAD now.. we will get even later"....by someone unknown
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

why is the equals method not overridden in stringbuffer class...how do i check if two stringbuffer objects have the same content?

If you had done a search in the forum, you would've landed on this thread...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: stringubuffer equals method
 
Similar Threads
equals() in StringBuffer
EQUALS method
equals in StringBuffer
FYI - Take care about these.......tips
Comparison failing