wood burning stoves 2.0*
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
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "StringBuffer" Watch "StringBuffer" New topic
Author

StringBuffer

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: StringBuffer