Content deleted Content added
m Undid revision 324046746 by 115.113.60.21 (talk) |
→Theory: Removing redirect to the article itself |
||
Line 5:
[[Java (Sun)|Java]]'s standard way to handle text is to use its <code>{{Javadoc:SE|java/lang|String}}</code> [[Class (computer science)|class]]. Any given <code>String</code> in Java is an [[immutable object]], which means its [[State (computer science)|state]] cannot be changed. A <code>String</code> has an [[Array data type|array]] of [[Character (computing)|characters]]. Whenever a <code>String</code> must be manipulated, any changes require the creation of a new <code>String</code> (which, turn, involves the creation of a new array of characters, and copying of the original array). This happens even if the original <code>String</code>'s value or intermediate <code>String</code>s used for the manipulation are not kept.
Java provides an alternate class for string manipulation, called a <code>'''[http://java.sun.com/j2se/1.5.0/docs/api/java/lang/StringBuffer.html StringBuffer]'''</code>
For these reasons, Java would handle an expression like
|