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
How do you control extraneous variables?
What is a superclass?
Why is java architectural neutral?
Highest level event class of the event-delegation model?
What is the use of flag?
What an i/o filter in java programming?
Define locale.
What is methods and methodology?
Explain about arraylist?
What purpose do the keywords final, finally, and finalize fulfill?
What is the difference between equals() and == in java?
What is an empty list in java?
How do you break a loop?
Can we overload the methods by making them static?
What is unicode in java?