public
synchronized int length()
Returns
the length (character count) of this string buffer.
public class StringBufferLength { public static void main(String args[]){ StringBuffer str = new StringBuffer("Hi, How are you"); System.out.println("Length of str is " + str.length()); } }
Output
Length of str is 15
No comments:
Post a Comment