File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes StringBuffer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "StringBuffer" Watch "StringBuffer" New topic


tony kanvas
Ranch Hand

Joined: Oct 26, 2002
Posts: 97
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Same question answered over here Marcus Green's JCHQ.NET Certification Discussion

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
tony kanvas
Ranch Hand

Joined: Oct 26, 2002
Posts: 97
Barry how we can make (b) take value of (a) thanks
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Tony, acting on the object pointed to by b, like this:

b.replace(0 , b.length() , a.toString());

Notice that b = a; did not work because within the method the parameter b acts like an alias of b such as b'; where b' = b had been executed at the time of the method invokation.

SCJP2. Please Indent your code using UBB Code
I agree. Here's the link:
subject: StringBuffer
It's not a secret anymore!