Strings are considered reference types yet can act like values. When shallow copying something either manually or with the MemberwiseClone(), how are strings handled? Are they considred separate and isolated from the copy and master?
Strings are considered reference types yet can act like values. When shallow copying something
Share
Strings ARE reference types. However they are immutable (they cannot be changed), so it wouldn’t really matter if they copied by value, or copied by reference.
If they are shallow-copied then the reference will be copied… but you can’t change them so you can’t affect two objects at once.