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 define set in java?
Can It is possible to synchronize the constructor of a Java Class?
What is the use of parseint in java?
What does a void function return?
What is the base class of all exception classes in java?
Which is a valid identifier?
What is the preferred size of a component in java programming?
What is string [] java?
Which collection allows duplicate values in java?
What is a boolean structure?
What is memory leak and how does java handle it?
Define packages in java?
What are the restriction imposed on a static method or a static block of code?
What is difference between java and java ee?
When should the method invokelater() be used?