Java StringBuffer length() method returns the length (character count).
public class LengthExample {
public static void main(String[] args) {
StringBuffer buffer = new StringBuffer("javaguides");
int length = buffer.length();
System.out.println(" length of the string '" + buffer + "' is :: " + length);
}
}
Output:
length of the string 'javaguides' is :: 10
Comments
Post a Comment