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
How do you check if an arraylist is not empty?
which pattern is default in scanner package?
Explain the importance of import keyword in java?
Explain where variables are created in memory?
What is void keyword?
What is map in java?
Explain the pointers in Java?
What are the four integer types supported by java?
Can an interface implement another interface?
Explain what is Marker interface?
Can an object subclass another object?
What does percent mean in java?
Can we convert list to set in java?
How use .contains in java?
What does flagged out mean?