Example:
String Str1="Hello";
String Str2=Str1;
Str1="Welcome";
Console.Writeline(Str1); //output is Welcome
Console.Writeline(Str2); //output is Hello
if String is reference type, then Str2 value should come as Welcome right?
Thanks.
Example:
String Str1="Hello";
String Str2=Str1;
Str1="Welcome";
Console.Writeline(Str1); //output is Welcome
Console.Writeline(Str2); //output is Hello
if String is reference type, then Str2 value should come as Welcome right?
Thanks.
Make a little change then Str2 would come Welcome try this.
String Str1 = "Hello";
Str1 = "Welcome";
String Str2 = Str1;
Console.WriteLine(Str1);
Console.WriteLine(Str2);