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 the default value of boolean variable?
List out the differences between array and arraylist in c#?
What does typeof return c#?
What is a console operator?
Is c# good for web development?
What is difference between method overriding and method overloading?
What is Covariance and contravariance in C#?
Is c# lazy thread safe?
What is the difference between method parameters and method arguments. Give an example?
Explain about CTS?
What is the difference between ref & out parameters in c#?
What is difference between the "throw" and "throw ex" in .net?
What is ilasm.exe used for?
What is verbatim string literal in c#?
What is alias in c#?