|
Answer» The MAIN differences between value TYPE and reference type are given below: - A Value Type holds the actual data directly within the memory location and a reference type contains a pointer which consists of the address of another memory location that holds the actual data.
- Value type stores its contents on the stack memory and reference type stores its contents on the heap memory.
- Assigning a value type VARIABLE to another variable will COPY the value directly and assigning a reference variable to another doesn’t copy the value, instead, it creates a second copy of the reference.
- Predefined data types, STRUCTURES, enums are examples of value types. Classes, Objects, Arrays, Indexers, Interfaces, etc are examples of reference types.
|