| Share this post! | Vote this! |
|
The String class is used to manipulate character strings that cannot be
changed. In simple terms, objects of type String are read only and
immutable. The StringBuffer class is used to represent characters that
can be modified. The significant performance difference between these
two classes is that StringBuffer is faster than String when performing
simple concatenations.
Operations using Strings in Java
In String manipulation code, character strings are routinely concatenated. Using the String class, concatenations are typically performed as follows:
Code:
String str = new String ("Hello ");
str += "World!!";



0 comments:
Post a Comment