What is the difference between string and string buffer in java? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

What is the difference between string and string buffer in java?

30th Jul 2017, 2:46 PM
santhosh kumar s
santhosh kumar s - avatar
1 Resposta
+ 5
String and StringBuffer both are the classes which operate on strings. StringBuffer class is the peer class of the class String. The object ofĀ  String class is of fixed length. The object of the StringBuffer class is growable. The basic difference between String and StringBuffer is that the object of the ā€œStringā€ class isĀ immutable. The object of the class ā€œStringBufferā€Ā mutable.
30th Jul 2017, 4:23 PM
Gregor Duff
Gregor Duff - avatar