aspose file tools*
The moose likes Beginning Java and the fly likes Can somebody explain these lines of code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Can somebody explain these lines of code?" Watch "Can somebody explain these lines of code?" New topic
Author

Can somebody explain these lines of code?

Klaas Vredevort
Greenhorn

Joined: Dec 27, 2005
Posts: 29


I don't understand the StringBuffer function in this file?
Joni Salonen
Ranch Hand

Joined: Jan 07, 2006
Posts: 53
It creates an empty StringBuffer in which you can put at least 128 characters, without needing to allocate more memory. If you add more than 128 characters it will have to allocate a new, larger internal character buffer.

You are given the option to specify the initial size because in a very tight loop reallocation may degrade performance. Which means that in 99% of the cases you don't need to do it.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Can somebody explain these lines of code?
 
Similar Threads
Can somebody show me how to implement buttons?
Please explain this line of code to me
Adding nulls to stringbuffers
a simple question
Adding a usedChar array in my program