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

Harsh kumar srivastava

Total Post:83

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

    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

NEWSLETTER

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