StringBuffer(int capacity) constructor creates empty string buffer with specified capacity as length

Q.  Which constructor creates an empty string buffer with the specified capacity as length.
- Published on 22 Jul 15

a. StringBuffer()
b. StringBuffer(String str)
c. StringBuffer(int capacity)
d. None of the above

ANSWER: StringBuffer(int capacity)


  • Nirja Shah   -Posted on 20 Aug 15
    The StringBuffer(int capacity) is a type of constructor which constructs a string buffer with no characters in it and the specified initial capacity.

Post your comment / Share knowledge

Enter the code shown above:
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)