| 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...
|
 |
 |
|
|
subject: String manipulation
|
|
|