StringBuffer and StringBuilder

StringBuffer and StringBuilder

The Javadoc:SE|java/lang|StringBuffer class is one of three core string classes in the Java programming language. Most of the time, the Javadoc:SE|java/lang|String class is used, however, the StringBuffer class is a mutable object while String is immutable. That means the contents of StringBuffer objects can be modified while similar methods in the String class that appear to modify the contents of the string actually return a new String object. It is more efficient to use a StringBuffer instead of operations that result in the creation of many intermediate String objects. The Javadoc:SE|java/lang|StringBuilder class, introduced in J2SE 5.0, differs from StringBuffer in that it is unsynchronized. When only a single thread at a time will access the object, using a StringBuilder is more efficient than using a StringBuffer.

StringBuffer and StringBuilder are included in the Javadoc:SE|package=java. _ja. objects] .


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • String Buffer — In object oriented programming, a String Buffer is an alternative to String. It has the ability to be altered through adding or appending, whereas a String is normally fixed or unchangeable. Java s approach Theory Java s standard way to handle… …   Wikipedia

  • Base Class Library — La Base Class Library (BCL) de Microsoft est une bibliothèque standard utilisée par tous les langages basés sur .NET Framework. Pour faciliter le travail du programmeur, .NET utilise la BCL pour encapsuler un grand nombre de fonctions communes,… …   Wikipédia en Français

  • Immutable object — Immutable and Immutability redirect here. For the Christian doctrine, see Immutability (theology). In object oriented and functional programming, an immutable object is an object whose state cannot be modified after it is created.[1] This is in… …   Wikipedia

  • Hexavigesimal — A Hexavigesimal numeral system has a base of twenty six.Base 26 is a fairly natural way of representing numbers as text using the 26 letter Latin alphabet. The number of interest is expressed in base 26, and then the 26 different base 26digits… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”