aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes String manipulation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "String manipulation" Watch "String manipulation" New topic
Author

String manipulation

Shrinath M Aithal
Ranch Hand

Joined: May 20, 2009
Posts: 82


i found it in mock test

could someone explain how it works? and why is it so?


Regards
Shri..

SCJP 5.0
Bob Wheeler
Ranch Hand

Joined: Apr 24, 2009
Posts: 317


SCJP 6 - SCJD - SCWCD 5 - SCBCD 5
JavaEnterpriseEditionFaq - TomcatFaq
Shrinath M Aithal
Ranch Hand

Joined: May 20, 2009
Posts: 82
??? why is sb1.equals(sb2) false?
Madhu Desai
Ranch Hand

Joined: Jun 14, 2009
Posts: 42
Bob Wheeler wrote:


Then, how to check the values between two StringBuffers are equal?


Thanks
Preparing for SCJP 6
Bob Wheeler
Ranch Hand

Joined: Apr 24, 2009
Posts: 317
Madhu Desai wrote:
Bob Wheeler wrote:


Then, how to check the values between two StringBuffers are equal?


Use the StringBuffer.toString() method and equals on base on the String class equals-method. This would be my proposal:


StringBuffer is final, so you can't sublclass it and create your own equals method.

cheers
Bob
Madhu Desai
Ranch Hand

Joined: Jun 14, 2009
Posts: 42
Bob Wheeler wrote:
StringBuffer is final, so you can't sublclass it and create your own equals method.

cheers
Bob


Thanks...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String manipulation