Wednesday 19 August 2015

What is difference between Value type and Reference Type in .Net

Value type : 

  • The data types which store the data directly into their memory location is known as value type.
  • Memory is allocated at compile time.
  • CLR  doesn't provide automatic memory management.
  • Value types are the fixed length like int,float,char etc...
Reference Types  :

  • The data types which doesn't store the data directly into their memory location rather reference to other memory location  where values are stored.
  • Memory is allocate at run time.
  • CLR provides automatic memory management.
  • Reference types are the variable length like object and string.

1 comment: