Hi
string is reference type, so why do i get this with the code below: Joe Joe Bill, Joe?
I would expect Joe Joe Bill, Bill because string is not a value variable.
Thanks again
string str = "Joe";
string str2 = str;
Console.WriteLine(str);
Console.WriteLine(str2);
str = "Bill";
Console.WriteLine(str);
Console.WriteLine(str2);
Rajeev KumarPosted Mar 14, 2023, 10:22 AM
String value can not be changed Because it is Refrence Type and a string is immutable each and every time it store a new addres for memory Location.
Satya KarkiPosted Jun 22, 2021, 5:23 PM
Valerie MeunierPosted Jun 22, 2021, 12:57 PM
Sachin SinghPosted Jun 22, 2021, 11:22 AM