ENHANCING STRING PERFORMANCE One of the simplest Java tips is concerning String performance. Most Java developers use it. "Do not use += with Strings instead, use a StringBuffer and its append method." However, a very important extension can be added to this. It's for initializing the StringBuffer to a good initial capacity. A simple example is a repeat method. This method takes a String 'str' and an int 'n', and returns a String in which str has been repeated n times. Here's the sample code: public String repeat(String str, int n) { StringBuffer buffer = new StringBuffer(); for(int i=0; i