Hi everyone,
First question here...
If I'm correct, String is a reference datatype, right?
See my code below:
In the end, I should expect both nameOne and nameTwo to be Andrew, but that's not the case.
nameTwo Stays Matthew. Can we conclude that String is special case and however it's a reference type, it behaves like a value type?
Thanks!
First question here...
If I'm correct, String is a reference datatype, right?
See my code below:
C#:
String nameOne = "Matthew";
String nameTwo = nameOne;
nameOne = "Andrew";
In the end, I should expect both nameOne and nameTwo to be Andrew, but that's not the case.
nameTwo Stays Matthew. Can we conclude that String is special case and however it's a reference type, it behaves like a value type?
Thanks!