Java examples for Language Basics:StringBuffer
int length() method of Java StringBuffer class returns the length of a StringBuffer object.
public class Main { public static void main(String[] args) { /* ww w.j a v a2 s.co m*/ StringBuffer sb = new StringBuffer("Hello World"); int len = sb.length(); System.out.println("Length of a StringBuffer object is : " + len); } }