What is the differnence between String Buffer and String
builder despite having knowledge that String builder is
faster than String Buffer and last one is threadsafe.please
tell another important difference.
Answer Posted / sanjay
WHEN AN APPLICATION NEEDS TO BE RUN ONLY BY SINGLE THREAD
IT IS BETTER TO USE STRING BUILDER BECAUSE IT IS
UNSYNCHRONIZED
WHEN AN APPLICATION NEEDS TO BE RUN BY MULTIPLE THREADS IT
IS BETTER TO USE STRING BUFFER BECAUSE IT IS SYNCHRONIZED
| Is This Answer Correct ? | 9 Yes | 3 No |
Post New Answer View All Answers
What do you mean by chromounits in java8?
Why do we use predicate in java?
What does jre stand for?
What do you mean by synchronized non access modifier?
What are the major drawbacks of external iteration?
What is console based application in java?
If an application has multiple classes in it, is it okay to have a main method in more than one class?
What is the purpose of void?
Explain exception chaining in java?
Why are pointers not secure?
Is zero a positive integer?
Is java hashset ordered?
What are the legal parameters?
What is the difference between int and integer in java?
What is set string?