public
StringBuffer(int capacity)
Constructs
a string buffer with no characters in it and the specified initial
capacity.
class StringBufferConstructor3{ public static void main(String args[]){ StringBuffer str; str = new StringBuffer(10); System.out.println("str = " + str); System.out.println("Length Of str is " + str.length()); System.out.println("Initial Capacity is " + str.capacity()); } }
Output
str = Length Of str is 0 Initial Capacity is 10
No comments:
Post a Comment