What is difference between String buffer and String builder?

devquora
devquora

Posted On: Jan 08, 2021

 

The differences between String buffer and String builder are as follows:

No.StringBufferStringBuilder
1)StringBuffer is synchronized.StringBuilder is non-synchronized.
1)StringBuffer is thread-safe.StringBuilder is not thread-safe.
1)Two threads can't call the methods of StringBuffer simultaneously.Two threads can call the methods of StringBuilder simultaneously.
2)StringBuffer is less accomplished than StringBuilder.StringBuilder is more accomplished than StringBuffer.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    NIIT Technologies Java Interview Questions

    What is abstraction?

    Abstraction is basically used to separate the useless data from the essential ones. Only the important things that need to be shown to the users are only being exposed. Here in these issues, the users...

    NIIT Technologies Java Interview Questions

    What is the difference between left and right outer join?

    The difference between the left and right outer join is as follows:S. N. Left Join Outer Join1 A left outer join provides the table in the FROM clause whose all rows are returned....

    NIIT Technologies Java Interview Questions

    Explain how HashMap works?

    HashMap in Java works on hashing principles. Hashing is a process in which hash functions are used to link key and value in HashMap....