Value type vs Reference type .net
.Net types are broadly classified into 2 categories based on storage:
- Value types
- Reference Type
Values types are allocated on Stack whereas reference types are allocated on Heap.
Example of value types are all primitive types (apart from string) and a User defined type called Struct.
Example of reference types are string, class, interface, delegates and Enum.