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
Distinguish between continue and break statement?
What are the types of serialization?
What does int32 mean in c#?
What are the ways in which client can create object on server in cao model?
Can you explicitly call a destructor?
what is the index value of the first element in an array?
What is the difference between inheritance and abstract class?
What's the difference between WindowsDefaultLocation and WindowsDefaultBounds?
What is an icollection in c#?
How many kinds of elements an array can have?
Which of the following operations can you not perform on an ado.net dataset?
Can an abstract class inherit from another abstract class c#?
What is the compiler of c#?
How Is The Dll Hell Problem Solved In .net?
Explain About DTS package