Java tutorial
/* * Output: length = 5 * */ public class MainClass { public static void main(String args[]) { StringBuffer sb = new StringBuffer("Hello"); System.out.println("length = " + sb.length()); } }