Thread: Help in Strings
View Single Post
Old 06-15-2008, 11:13 AM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,173
Belisarius is on a distinguished road
In Java, and Object is a very abstract representation of data. "System" is a representation of the computer you're working on, "Socket" is a representation of a network connection, so on and so forth.

A "String" is an Object that represents words. For instance, everything I've typed could be represented as a "String". A "StringBuffer" is an Object much like a "String", but designed to be more efficient and faster, as the cost of flexibility. You need to do a little bit more work as a programmer to use StringBuffers, but your code will be faster as a result.

The "capactity" method is described in the Javadoc for StringBuffer, which can be found here. I have a link to the API at the top of the Java forum here - I suggest you take a quick look there as it's very helpful to any Java programmer.
__________________
GitS

Last edited by Belisarius; 07-26-2008 at 09:04 AM.
Belisarius is offline   Reply With Quote