Reference type (C # Reference)

C # there are two types: reference types and value types. Storing a reference type variable whose data (object) referenced directly contain the value of its variable of type data. With reference types, two types of variables can reference the same object; therefore, the operation performed by a variable affect the object referenced by another variable. For value types, each variable has its own copy of the data, the operation performed on a variable does not affect (except in, ref and out parameter variables; refer to another variable  in , ref  and  out  parameter modifiers).

The following keyword is used to declare a reference type:

C # also provides the following built-in reference types:

 

 

https://docs.microsoft.com/zh-cn/dotnet/csharp/language-reference/keywords/reference-types

Guess you like

Origin www.cnblogs.com/deepalley/p/12173921.html