Why are strings in c# immutable?



Why are strings in c# immutable?..

Answer / Sanjeet Kumar Choudhary

Strings in C# are immutable to allow for efficient handling, as once a string is created it cannot be changed. This ensures that the content of a string can always be accessed without having to worry about it being modified.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Can we throw exception from catch block

6 Answers   Microsoft,


What is the use of private constructor in c#?

1 Answers  


Why it's said that writing into .NET Application Configuration Files is a Bad Idea?

1 Answers   DELL,


Is it possible to restrict the scope of a field/method of a class to the classes in the same namespace?

1 Answers  


What sort algorithm does c# use?

1 Answers  


If you define a user defined data type by using the class keyword, is it a value type or reference type?

1 Answers  


Can you store multiple data types in System.Array?

20 Answers   Satyam, Siebel Systems,


Can abstract classes be final?

1 Answers  


Is as keyword in c#?

1 Answers  


what is a template?

3 Answers   Choice Solutions,


Why is c# used?

1 Answers  


What do you mean by default constructor?

1 Answers   NIIT,


Categories