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
KANU

... opposition party, the Kenya People's Union[?] (KPU), was formed in 1966, led by Jaramogi Oginga Odinga[?], a former vice president and Luo elder. The KPU was banned and ...

 
 
 
This page was created in 23.3 ms