Mega Code Archive

 
Categories / C# Book / 01 Language Basics
 

0011 Types and variables

There are two kinds of types in C#: value types reference types. Variables of value types directly contain their data. Variables of value types have their own copy of the data. Variables of reference types store references to their data(objects). Variables of reference types may reference the same object. C#'s value types includes: simple types enum types struct types nullable types C#'s reference types are: class types interface types array types delegate types. The following table lists the concrete types and their group names: Signed integral sbyte, short, int, long Unsigned integral byte, ushort, uint, ulong Unicode characters char IEEE floating point float, double High-precision decimal decimal Boolean bool Enum enum EnumTypeName {...} Struct struct StructTypeName {...} Nullable value type nullable value