jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes the capacity()  method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "the capacity()  method" Watch "the capacity()  method" New topic

the capacity() method

Khurram Ajmeri

Joined: Nov 24, 2001
Posts: 6
hello there
how does capacity() method in StringBuffer work?
Azam Bukhari
Ranch Hand

Joined: Oct 03, 2000
Posts: 58
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

Don't wanna invent the wheel again!!
I agree. Here's the link: http://aspose.com/file-tools
subject: the capacity() method
It's not a secret anymore!