hello there how does capacity() method in StringBuffer work?
posted 15 years ago
The Capacity() method for the string buffer works as follows... The default length of a String buffer object is 16 initially. When we initialize this object with a string let be it like "Paki" then when u go & try out the length of this Buffer object u ll get 4 but when u go & try to find out the capacity()...it will return 16... In other words its a tring with no limitation or boundaries