// deliberately *not* using StringBuffer / StringBuilder, // as a real app would have many transient string variables
StringBuilder buf = new StringBuilder( s1); buf.append( s2); String cat = buf.toString();
String cat = s1 + s1;
The loop is in the benchmark so I don't have to write code dealing with many different string values of differing size manually.
The loop is in the benchmark so I don't have to write code dealing with many different string values of differing size manually.