Data Types in .Net

There are 2 kinds of data types in .Net. One is called Reference and the other is called Value.

Reference Data Type

For Reference data type, heap portion of memory is used for storage. If data type is defined through delegate, interface, class etc. then it would be called Reference data type. For example, String, Object, Array.

Value Data Type

As far as Value data type is concerned, these are manipulated in the stack portion of memory and these are like primitive data types.
If data type is defined through “structure” or “enum” then it would be Value data type.
In Java, we cannot put user-defined data type on stack (means cannot make it primitive) which facility is given in .Net.

4 out of 5 based on 5 user ratings