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 is mean by collections in java?
What is the method to expand and collapse nodes in a jtree?
Write a program to print the pattern given below
What is scope & storage allocation of global and extern variables? Explain with an example
How to sort an unsorted array in java?
How many bits is size_t?
Explain wrapper classes in java?
What is the full name of java?
Can you have two constructors in java?
Can you extend main method in java?
Is null a string in java?
What is method overloading and method overriding?
Enlist few advantages of inheritance?
what is the purpose of "virtual"?
Can we have any code between try and finally blocks?