| Author |
String Vs StringBuffer
|
Reggie McDougal
Ranch Hand
Joined: Sep 27, 2004
Posts: 69
|
|
If creating a string with lots of data should I use a stringBuffre instead of the following... Is there a better way of doing this if sh can some one give me some example code. Reg
|
You can never drink too much
|
 |
Mike Gershman
Ranch Hand
Joined: Mar 13, 2004
Posts: 1272
|
|
Your one line concatenations work fine as a String. StringBuffer has the edge where you are building up a String out of many pieces, perhaps in a loop.
|
Mike Gershman
SCJP 1.4, SCWCD in process
|
 |
Sanjaya Sugiarto
Ranch Hand
Joined: Mar 25, 2004
Posts: 229
|
|
|
And StringBuffer has a big performance benefit too.
|
<a href="http://www.wi.hs-furtwangen.de" target="_blank" rel="nofollow">Business Information Technology - Hochschule Furtwangen University, Germany</a>
|
 |
 |
|
|
subject: String Vs StringBuffer
|
|
|