Satheesh Kumar Pilli
Value type v/s Reference type?
By Satheesh Kumar Pilli in .NET on Aug 20 2014
  • Mohamed Darwish
    Jan, 2016 6

    Value type Stored in StackReference type stored in Heap , Destroyed by Garbage Collection

    • 0
  • Navratna Pawale
    Sep, 2014 17

    The value types are the types which can be fixed in size i.e. int, float, double, short, etc. And the reference types are the types which can be variable length size i.e. string and object. the value types have default values as 0 and the reference types have default values as NULL. the Value types are converted to reference types, is known as boxing. e.g. int i = 100;object obj = i; // boxing And the value types i.e. converted into reference types are again converted back into the value type is known as un-boxing. This conversion is done by an explicit conversion as:- e.g. int j = Convert.ToInt(i); //Un-boxing

    • 0
  • Mahanti Chiranjeevi
    Sep, 2014 9

    value type will not get destroyed by garbage collector where as reference type get destroyed by garbage collector.

    • 0
  • Virendra Gour
    Sep, 2014 7

    go to http://msdn.microsoft.com/en-us/library/4d43ts61(v=vs.90).aspx

    • 0
  • Satheesh Kumar Pilli
    Aug, 2014 20

    Data types are classified into 2 categories First one is Value types and other one is Reference typesI) Value types: Value types stored the data on STACK(First In Last Out) which is a place where data stores in fixed length such as int, float, char etc...Note:STACK is under control of Operating System which doesn't provide automatic memory management but it is faster in access.II) Reference types: Reference types are stored on HEAP memory which is another place where data can be stored. C# supports two predefined reference types i) Object, ii)String Note: HEAP is more managed and more over it will be under the control of "Garbage Collector"

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS