ATSWL - Append To String Within a Loop

Performance enhancements can be obtained by replacing String operations with StringBuffer operations if a String object is appended to within a loop.

Wrong

`public class ATSWL {
public String func () {
String var = "var";
for (int i = 0; i < 10; i++) {
var += (" " + i);
}
return var;
}
}`

Tip: Use StringBuffer class instead of String

Right

`public class ATSWL {
public String func () {
StringBuffer var = new StringBuffer("var");
for (int i = 0; i < 10; i++) {
var.append(" " + i);
}
return var.toString();
}
}`