C# Datatype

29 Apr 2024
1 min read  

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.

Share Article
About Author
Juber Qureshi (Technical Architect, Microsoft Certified Trainer)

He is Technical Architect and have more than 11 years of experience in Microsoft technologies (Asp.Net Web Forms, MVC,  Web API, Entity framework, .Net Core, MS Azure etc). He love to learn new technologies and share it as simple manner as possible.

Learn to Crack Your Technical Interview

Accept cookies & close this