1 package conditionaluseofapi;
3 /** Implementation for string concatention using Java 5 only.
5 * StringBuilder is supposed to be faster than StringBuffer as it
6 * is not synchronized and as such it is does not waste time with
7 * synchronization when its methods are called.
9 * @author Jaroslav Tulach <jtulach@netbeans.org>
11 final class StringBuilderAdd15 implements AddString {
13 private StringBuilder sb = new StringBuilder();
15 public void addString(String msg) {
19 public String getMessage() {
23 public String toString() {
24 return "New Shiny and Fast Java 5 Implementation";