What is a string in C# programming?

 Posted by Goud.Kv on 9/3/2014 | Category: C# Interview questions | Views: 1307 | Points: 40
Answer:

Generally string is an immutable object which represents a series of unicode characters.
Immutable means they cannot be modified.

But, for example,
string str = "You";

str = "Me";
In C#, we are able to modify a string.

Hence, the important thing of immutability is about where the string reference is pointing to.

In the above example, str is pointed to "You" and then it has been changed (pointed) to "Me".


Asked In: Spotted While Learning | Alert Moderator 

Comments or Responses

Login to post response