Encyclopedia > StringBuffer

  Article Content

StringBuffer

In computer programming, the StringBuffer class is one of two core string classes in Java. Most of the time, the String class is used. The point of this class is it is a mutable object while String is immutable (see immutable object). That means the content of StringBuffer objects can be modifed while every methods of string class returns a new string and result in improving runtime efficiency. For example, following code uses StringBuffer instead of String for performance improvement.
Reader reader = new FileReader ("file");
char buf[] = new char[10240];
StringBuffer sbuf = new StringBuffer ();
while (reader.ready ()) {
	sbuf.append (buf, 0, reader.read (buf));
}



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
Bullying

... In Classical Antiquity[?] it did not always have inherently negative implications, it merely designated anyone who assumed power for any period of time without a ...

 
 
 
This page was created in 24.2 ms