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: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets