What is difference between string and stringbuffer?



What is difference between string and stringbuffer?..

Answer / Sakshi Singh

A String in Java is an immutable class, meaning once created, its contents cannot be changed. On the other hand, a StringBuffer (or StringBuilder) is mutable and allows for modifications to its content.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

How to access a variable if it is declared as private?

3 Answers  


Write a program to print fibonacci series up to count 10.

1 Answers  


Is java util regex pattern thread safe?

1 Answers  


How to create a base64 decoder in java8?

0 Answers  


where exactly collections are usefull in realtime

2 Answers  


What is %d in printf?

1 Answers  


Explain the difference between hashmap and hashtable in java?

1 Answers  


What is double word?

1 Answers  


How applets will communicate with each other?

1 Answers  


Will the compiler creates a default constructor if I have a parameterized constructor in the class?

1 Answers  


what is jms? features of jms

2 Answers   CTS,


How dead lock situation occurs in java and how you can identify it?

1 Answers  


Categories