public class MyStringBuffer { final int stringlänge = 5; String myString; MyStringBuffer() { StringBuffer str = new StringBuffer(); for(int i=0;i<stringlänge;i++) { str.append(" "); } myString = str.toString(); System.out.println("String : \""+myString+"\""+" Stringlänge: "+myString.length()); } public static void main(String args[]) { new MyStringBuffer(); }}