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 / vinodkumar uttara student
StringBuilder all methods are not synchronized , nothing
changes done in this class , it is same as StringBuffer.I
mean to say , more than one thread can be execute
StringBuilder object , because there is not a concept of
lock on object , any thread can execute on this object.Where
as StringBuffer class all methods are synchronized only one
thread at time can access synchronized method , because it
get lock on object.
Please help me , if i am right?
is it correct,
thanks for the reply
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What is the difference between overriding and overloading in OOPS.
List some important features of java 10 release?
Explain about OOPS concepts and fundamentals.
Explain the difference between throw and throws in java?
What is binary search in java?
What things should be kept in mind while creating your own exceptions in java?
What is communist flag?
What does the string method compareto () do?
Why put method is used?
What is floating data type?
Is void a return type?
What is isa relationship?
How do you allocate memory to object?
Can a class be private?
What is illegal identifier in java?