Is string reference type / value type?
Answer Posted / djfox7200x
Strings are immutable.Hence they behave like a value type
when they are actually reference type;
eg. string objA="cat";
//cat is an immutable string in memory and objA points to
it.
string b=a; //reference is copied to b;
a="dog"; new immutable object created and a points to it;
//b is still cat since its refernce has not changed
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is protected internal modifier in C#?
What is a dbml?
What is class in oops with example in c#?
What is a dll in c#?
What is clr namespace?
Which operator cannot be overloaded in c sharp?
What are the delegates in c#?
Explain about CTS?
Why do we need collections in c#?
what are the contents of an assembly ?
What is dataset and dataadapter in c#?
What is oledbconnection c#?
What's the c# syntax to catch any possible exception?
How does insertion sort work?
if a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors; can you enforce a call from an inherited constructor to a specific base constructor?