18 Apr
2013
18 Apr
'13
9:02 p.m.
On Thu, Apr 18, 2013 at 10:34 AM, Jim Gish <jim.gish@oracle.com> wrote:
That was a nice idea, but you don't want to change the value when you do toString(). Otherwise, if you subsequently add a new element, you're hosed because you've already added on the suffix.
You can cheaply save the current length, append the suffix, call toString, and reset the length back to the old value to avoid the overhead of String "+".