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 components of window?
What is hash c#?
Can I use ReaderWriterLock instead of Monitor.Enter/Exit for Threading?
What is difference between assembly and dll?
Explain when should you call the garbage collector in .net?
Distinguish between a class and struct?
What are c# attributes and its significance?
How does foreach loop work in c#?
What is yield return in c#?
Hi to all..I have to create an intranet application on C#.NET windows Application so please please let can you people help me as iam new in .NET and if u have any samples or website address from where i can get sample please let know.
Why do we use generics in c#?
Can constructor be protected?
What are the extension methods in c#?
Are structs faster than classes?
Can arraylist hold primitive types?