TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - Java Coding Standard
Search

Rule:  Optimization6Checked automatically with code checker

This rule is Obsolete
Synopsis:Prefer StringBuffer over += for concatenating strings
Language:Java
Severity Level:6
Category:Optimization


Description:
Finds usages of += for appending strings.
public class Foo {
 void bar() {
  String a;
  a = "foo";
  a += " bar";
  // better would be:
  // StringBuffer a = new StringBuffer("foo");
  // a.append(" bar);
 }
}