Results 1 to 1 of 1
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:
StringBuffer sb = new StringBuffer("MyString"); sb.insert(2,"Test"); System.out.println(sb); }
- By orchid in forum New To JavaReplies: 6Last Post: 08-12-2008, 02:39 PM
- By Pooja Deshpande in forum New To JavaReplies: 5Last Post: 04-16-2008, 01:51 PM
- By Pooja Deshpande in forum New To JavaReplies: 9Last Post: 04-11-2008, 10:38 AM
- By Marcus in forum AWT / SwingReplies: 2Last Post: 07-04-2007, 06:50 AM