引用类型(C# 参考)Reference types (C# Reference)

C# 中有两种类型:引用类型和值类型。There are two kinds of types in C#: reference types and value types. 引用类型的变量存储对其数据(对象)的引用,而值类型的变量直接包含其数据。Variables of reference types store references to their data (objects), while variables of value types directly contain their data. 对于引用类型,两种变量可引用同一对象;因此,对一个变量执行的操作会影响另一个变量所引用的对象。With reference types, two variables can reference the same object; therefore, operations on one variable can affect the object referenced by the other variable. 对于值类型,每个变量都具有其自己的数据副本,对一个变量执行的操作不会影响另一个变量(in、ref 和 out 参数变量除外;请参阅 inrefout 参数修饰符)。With value types, each variable has its own copy of the data, and it is not possible for operations on one variable to affect the other (except in the case of in, ref and out parameter variables; see in, ref and out parameter modifier).

下列关键字用于声明引用类型:The following keywords are used to declare reference types:

C# 也提供了下列内置引用类型:C# also provides the following built-in reference types:

请参阅See also