WHAT IS DIFFERENCE BETWEEN STRING,STRING BUFFER AND STRING BUILDER?

Harsh kumar srivastava

Total Post:65

Points:325
C# 
C#
 58  View(s)
Ratings:
Rate this:
  1. Harsh kumar srivastava

    Post:65

    Points:325
    WHAT IS DIFFERENCE BETWEEN STRING,STRING BUFFER AND STRING BUILDER?

    String is immutable, and StringBuffer and StringBuilder is mutable. If you try to alter String values, another objects get created. But in string buffer and string builder you change their values.

    And the difference between StringBuffer and StringBuilder is that StringBuffer is thread-safe.But StringBuilder is more efficient than StringBuffer.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!