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
Are objects passed by reference in c#?
What does int32 mean?
How much time will it take to learn unity?
What is data dictionary in c#?
What is ado c#?
What is gui in c#?
What is the purpose of c#?
What are custom exceptions?
What is a strong name in c#?
What is dto c#?
What is delimiter in c#?
How to use reflection to call generic method?
What is the difference between static and private constructor in c#?
What is public void in c#?
Is c# dictionary a hash table?