hi
 u should go for only one StringBuffer variable.
if u go for again & again new StringBuffer then it is
equivalent to String objects.
jayakumar



--- Sushil Singh <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a question regarding String and StringBuffer
> class. Recently I
> read that we should not use "+" concatenation since
> it will create
> temporary objects, instead we should use
> StringBuffer.  My JSP is
> producing series of System.out.println, like:
> .......
> some process
> ....
> System.out.println(new
>
StringBuffer("test").append("test1").append("test2"));
> ----
> System.out.println(new
>
StringBuffer("test3").append("test4").append("test5"));
> ----
> and so on.
>
> Now my question is that whether I should have one
> StringBuffer variable,
> append it and then displays or everytime "new
> StringBuffer".  Which way
> is the best, any feedback will be highly
> appreciated.
>
> Thanks in advance.
>
> Sushil
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED]
> and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives:
>
http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
>
http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help:
http://www.lsoft.com/manuals/user/user.html


__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to