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

Total Post:83

Points:415
C# 
C#
 313  View(s)
Ratings:
Rate this:
  1. Post:83

    Points:415
    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