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
If a class derives from another class, will the derived class automatically contain all the public, protected, and internal members of the base class?
Is collection a data structure?
What is the namespcae generally given to the webpage of the .NET Framework ?
List the two important objects of ado.net and also list the namespaces that are commonly used in ado.net to aid in connection to a database.
What is different between Implicit conversion and Explicit conversion in C#?
What is the difference between an application domain and a process?
Why do we use public static void main in c#?
Which class comes after the SortedList class?
What is anonymous methods in c#?
What is serialization in c#?
What is the difference between interface and inheritance in c#?
Explain the three test cases in unit testing?
Explain static class members.
Can namespace contain the private class?
Explain Constructor and destructor?