Results 1 to 1 of 1
Thread: StringBuffer
-
StringBuffer
StringBuffer is very much like Strings but it has an edge we it comes to altering Strings. StringBuffer can be modified which is not the case when using Strings. If you are using String and try to alter it, it is internally converted into StringBuffer, altered and then a new String is created with the altered value. This all is done internally and takes some resources.
Syntax of declaring StringBuffer is as follows:
Java Code:StringBuffer sb = new StringBuffer("MyString"); sb.insert(2,"Test"); System.out.println(sb); }
Java Code:MyTestString
Similar Threads
-
StringBuffer situation
By orchid in forum New To JavaReplies: 6Last Post: 08-12-2008, 02:39 PM -
Difference between StringBuilder & StringBuffer
By Pooja Deshpande in forum New To JavaReplies: 5Last Post: 04-16-2008, 01:51 PM -
StringBuilder v/s StringBuffer
By Pooja Deshpande in forum New To JavaReplies: 9Last Post: 04-11-2008, 10:38 AM -
Help with StringBuffer
By Marcus in forum AWT / SwingReplies: 2Last Post: 07-04-2007, 06:50 AM
Bookmarks