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 do you understand by 'access specifiers' in C#?
What is an Interface in C#?
How to implement singleton design pattern in c#?
What is meant by desktop application?
what are some characteristics of an array?
Can we inherit private members of class in c#?
What is the use of 'as' Keyword in C# ?
What is thread.sleep()?
What is xml comments in c#?
Why delegates are required?
What is a base class in C#?
What is a collection in c#?
What is yield break in c#?
What is the use of 'using' statement in c#?
Explain how to parse a datetime string?