what is difference between String buffer and String builder?

Answer Posted / rajujohn

hi All
Both are mutable ,that means we can change value of the
instance variable using append,insert and ...
But only one difference when you go for the multi-thread
concept you use StringBuffer,Because it is thread safe ,that
means, if one thread access this stringbuffer variable on
the time another thread cant access this stringbuffer,so
stringbuffer is slowest performance compare to stringbuilder.

by raju.j

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is hashmap in java?

561


How does map works in java?

507


What is command line argument in java?

603


What is an off by one error in java?

495


Difference between serialization and deserialization in java?

650






What is the functionability stubs and skeletons?

681


What does java se mean?

584


What is arrays fill in java?

541


What is the difference between interface & abstract class?

557


What is a prefix function.write down a code to compute prefix function.

534


Difference between static binding and dynamic binding?

563


When do we use hashset over treeset?

529


What is the difference between a synchronized method and a synchronized block?

599


What are loops in java?

548


Can we inherit a class with private constructor?

564