What is difference between string and stringbuffer in c#?



What is difference between string and stringbuffer in c#?..

Answer / Nirpendra Singh

In C#, String is an immutable class while StringBuilder is a mutable class. This means that whenever you change the contents of a String, a new object is created, whereas StringBuilder allows for efficient changes to its contents by reusing memory.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What is a struct in C#?

1 Answers   Arigo Infotech,


What is the difference between final finally and finalize in c#?

1 Answers  


Why do we need to call CG.SupressFinalize?

1 Answers  


what is the index value of the first element in an array?

1 Answers  


What is Delegate and what is it used for ?

1 Answers   NA,


What is the difference between System.console.WriteLine() and System.console.Write() function?example?

1 Answers   HCL,


Is var a data type?

1 Answers  


What is an object and a class?

1 Answers  


What is a property c#?

1 Answers  


What are the types of comment in c# with examples?

1 Answers  


What does ienumerable mean?

1 Answers  


What is get set in c#?

1 Answers  


Categories