Difference between Value Type and Reference Type

 Updated on October 09, 2014     VIKRAM     874

Conceptually, the difference is that a value type stores its value directly, whereas a reference type stores a reference to the value.

These types are stored in different places in memory; value types are stored in  an area known as the stack, and reference types are stored in  an area know as managed heap.

Predefined Value Types:

Interger Types: C# supports eight predefined integer types: sbyte, short, int, long, byte, ushort, uint, and ulong.

Floating-Point Types: float, doble

The Decimal Type: decimal

The Boolean Type: bool

The Character Type: char

Predefined Reference Types:

C# supports two predefined reference types, object and string.

If you enjoyed this post, please like (or) share this article.