"Difference between value type and reference type "
- Value Type: Value Types derive from System.ValueType, which is derived from System.Object.In other words, you can say that a data type is a value type that holds data value within its own memory space.For example, consider the following integer variableint a=80;The system stores 10 in the memory allocated for the variable 'a'.The following data types are all of the value types:
- bool
- byte
- char
- decimal
- double
- enum
- float
- int
- long
- sbyte
- short
- struct
- uint
- ulong
- ushort
Reference Type:ReferenceType doesn’t store the value directly. It Stores the address where the value is stored. In other words, you can say that reference type contains a pointer to another memory location that points the address of any variable.