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

C# 
C#
 669  View(s)
Ratings:
Rate this:
  1. 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