Is string reference type / value type?
Answer Posted / malli
String Is Reference Type Ex
string StrName1 = "Test";
string StrName2 = StrName1;
StrName2="Test1";
Console.WriteLine("StrName1="+StrName1);
Console.WriteLine("StrName1=" + StrName2);
Object objStrName1 = "Test";
Object objStrName2 = objStrName1;
objStrName2 = objStrName1;
objStrName2 = "Test1";
Console.WriteLine("objStrName1=" + objStrName1);
Console.WriteLine("objStrName2=" + objStrName2);
Console.WriteLine("Malli");
OutePut:-
StrName1=Test
StrName1=Test1
objStrName1=Test
objStrName2=Test1
No More Discusion...
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is using keyword?
can you declare an override method to be static if the original method is not static?
What is the namespace for the thread class?
Is there an equivalent to the instanceof operator in visual j++?
What is hash c#?
Explain the difference between .net and c#?
What do you mean by string objects are immutable?
When should you use generics?
what are implementation inheritance and interface inheritance?
What is readline c#?
Why abstraction is used in c#?
How does dll hell solve in .net?
What is int parse in c#?
What is difference between private and protected in c#?
What is console write in c#?