How can you find the length and capacity of a string buffer ?
public int capacity() Returns the current capacity. The capacity is the amount of storage available for newly inserted characters, beyond which an allocation will occur. Returns: the current capacity. public int length() Returns the length (character count). Specified by: length in interface CharSequence Returns: the length of the sequence of characters currently represented by this object.