Difference Between String and StringBuffer Objects in Java



String class is immutable once you create an object of string you can modify its data.

The StringBuffer class is immutable, once you create a StringBuffer object you can change/modify the contents of it.

This class provides various methods to manipulate its data such as append(), delete(), insert() etc.

Updated on: 2019-07-30T22:30:20+05:30

381 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements