Saturday 5 July 2014

Value type and Reference type

Value type:
Stores the value directly into their memory locations
Memory is allotted at compile time
Memory allocation is made at stack.
CLR Does not provide “Automatic memory management”
EX: int, float, double, sbyte, long, short
Reference Type:
Memory is allotted at run time.
At “Heap” location.
CLR provide “Automatic memory management”
EX: object, string