Difference between String and StringBuffer in Tabular Form
Contents
String and StringBuffer Difference
- The Key Difference between String and StringBuffer is in the below table.

String and StringBuffer Comparison Chart
String | StringBuffer |
---|---|
String class is immutable. | StringBuffer class is mutable. |
Object of string class can not be changed. | Object of StringBuffer class can not be changed. |
String is fixed length constants. | StringBuffer is a variable length constant. |
Strings are slow and consume more memory. | StringBuffers are fast and consumes less memory. |
String class uses String constant pool for storage. | StringBuffer uses Heap memory for storage. |