Working with Data Types in C#

 

Data type specifies the type of data&size of the Data. C#.Net datatypes are divided into two types

 

1)Value types

2)Reference types

 

Value types:

1)value types holds the data directly.

2)value Type does not holds any default value.

3)value types will stored in STACK memory compile time.

4)value types are faster in accessing.

5)value types EX:pre-defined datatypes, Structures, Enums.

 

Reference types:

1)Reference type holds the address but not data.

2) Reference type holds some default value.

3) Reference type will be stored in HEAP memory at runtime.

4) Reference type (heap) are slower in accessing.

5) Reference type EX: classes, objects, Arrays, Delegates, Interfaces, etc..