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
Is typeof c#?
How many types of delegates are there in c#?
Can an array be null c#?
What is the difference between dll and lib?
what is c# command?
How can you achieve run time polymorphism in C#?
How big is an int16?
Should I use double or float?
What is the difference between int and int in c#?
What framework is used for performance testing/load testing?
Is datetime nullable c#?
What is object pool in .net?
Which language is used for desktop application?
What exactly is serverless?
What is class method?