Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 1.62 KB

reference-types.md

File metadata and controls

34 lines (27 loc) · 1.62 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Reference types - C# Reference
Reference types
07/20/2015
cs.referencetypes
reference types [C#]
C# language, reference types
types [C#], reference types
801cf030-6e2d-4a0d-9daf-1431b0c31f47

Reference types (C# reference)

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. With value types, each variable has its own copy of the data, and it's 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# also provides the following built-in reference types:

See also