In C # /. Net objects, they can be classified as values ββor reference types [1]. Value types are any types that are inferred from System.ValueType and defined in C # with a declaration of type struct . They are transmitted by copy / value.
Reference types are types that are not related to System.ValueType and are defined in C # with the class keyword. Identifiers for instances of reference types are called references (similar to pointers). They are also passed by default, but only the link is not passed by the whole object.
Your question also mentioned that string instances are passed by copy. string in .Net is a reference type (derived directly from System.Object ) and, therefore, is not passed in as a complete copy.
[1] Pointers may deserve their own class, but I ignore them for discussion.
source share