Please enable Javascript to correctly display the contents on Dot Net Tricks!

Data Type

Posted On : 28 Jan 2015
Updated On : 10 Feb 2015
Total Views : 10127

Data Type refers to the type of data that can be stored in a variable. It also specifies how much memory would be allocated to a variable and the operations that can be performed on that variable.

C# is rich in data type which is broadly divided into two categories.

  1. Value Type

  2. Reference Type

Value Type

A value type variable store actual values. Also, value types are stored in a stack. Values types are of two types - built-in and user-defined. Value types are derived from System.ValueType.

Reference Type

A reference type variable stores a reference to the actual value. It means reference type contains a pointer to another memory location that holds the actual data. Also, reference types are stored in a heap. Reference types are of two types - built-in and user-defined. Reference types are derived from System.Object.

What do you think?

I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome.