Difference between string, stringbuffer and stringbuilder?



Difference between string, stringbuffer and stringbuilder?..

Answer / Kanchan Yadav

`String` is an immutable class in Java. Once a `String` object is created, its value cannot be changed. On the other hand, both `StringBuffer` and `StringBuilder` are mutable classes that can change their values over time. `StringBuffer` is synchronized, while `StringBuilder` is not.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

how to print output with out using sop statements

5 Answers   UHG,


What are autoboxing and unboxing? When does it occur?

1 Answers  


What is replaceall in java?

1 Answers  


class A { public void disp(int a,int b) { System.out.println("hai"); } } class B { public void disp(int a,int b,int c) { System.out.println("hai"); } } above program is overloading or overriding?

9 Answers   Infosys, Wipro,


what are the design patterns in struts?

1 Answers  


What is the purpose of the main method?

1 Answers  


Describe how to implement singleton design pattern in struts.

1 Answers  


How concurrent hashmap works?

1 Answers  


how to call a method in different package?

4 Answers  


Which One is optimal to choose ? Syncronized hash map or Hash table with single thread model? How can a hash map syncronized with out using syncrozed blocks in programm?

3 Answers   Four soft,


Why do we need data serialization?

1 Answers  


Difference between Primary key and unique key?

4 Answers  


Categories