In this post we are going to see about types in c#.There are two kinds of types in C# value types and Reference types. Variables of value types directly contain the data.but in reference types in store the reference of the data.
C# value types are divided in to simple types, enum types, struct types, and nullable types.
C# reference types are divided in to class types, interface types, array types and delegate types.
C# value types are divided in to simple types, enum types, struct types, and nullable types.
C# reference types are divided in to class types, interface types, array types and delegate types.
Category
|
Description
|
|
Value
types |
Simple types
|
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 types
|
User-defined types of the form enum Enu { }
|
|
Struct types
|
User-defined types of the form struct Str {}
|
|
Nullable types
|
Extensions of all other value types with a null value
|
|
Reference
types |
Class types
|
Ultimate base class of all other types: object
|
Unicode strings: string
|
||
User-defined types of the form class Copy {...}
|
||
Interface types
|
User-defined types of the form interface Itest {...}
|
|
Array types
|
Single- and multi-dimensional, for example, int[] and int[,]
|
|
Delegate types
|
User-defined types of the form e.g. delegate int Del(...)
|
from this post you can learn the types present in c#.