Differences between String and StringBuffer in Java
by, 04-26-2012 at 06:29 PM (753 Views)
Major difference that exist b/w StringBuffer and String is the immutable string, while mutability of the StringBuffer means that StringBuffer object could be modified once it has been created, without creation of new object. StringBuffer is made an ideal choice by this mutable property to deal with Java strings. StringBuffer can be converted into String by the help of toString() method. StrinBuffer Vs String, or difference b/w String & StringBuffer is most popular for the interview questions, either 1st round or phone interview. StringBuilder is also included now a days and StringBuiler Vs StringBuffer Vs String is asked. So you shall be prepared, for that. Difference b/w StringBuilder and StringBuffer will be shown in next section.