Data Types In C#

C# is a specific dialect. That is to say, you can't utilize variables without information sorts. Information sorts tell the compiler which kind of information is utilized for handling. For example, on the off chance that you need to work with string esteem then you should dole out string sort variable to work with

There are the following data types in C#,
  • Value types 
    These are the built-in primitive data types, such as char, int, and float, as well as user-defined types declared with struct.

  • Reference types
    Classes and other complex data types that are constructed from the primitive types. Variables of such types do not contain an instance of the type, but merely a reference to an instance

Reference Type
The reference sorts don't contain the genuine information put away in a variable, however they contain a reference to the factors.

As such, they allude to a memory area. Utilizing numerous factors, the reference sorts can allude to a memory area. On the off chance that the information in the memory area is changed by one of the factors, the other variable consequently mirrors this adjustment in esteem. Cases of implicit reference sorts are: protest, dynamic, and string class. 
Nullable Types

Esteem sorts can't be doled out as invalid, reference sorts can. Applications that work with databases manage the invalid esteem. Along these lines, uncommon nullable sorts were brought into the C# dialect. Nullable sorts are occurrences of the System.Nullable<T> struct.
  1. using System;  
  3. class Employee  
  4. {  
  5. static void Main()  
  6. {  
  7.    Nullable<bool> Name= null;  
  8.    int? Age = null;  
  10.    Console.WriteLine(Name.HasValue);  
  11.    Console.WriteLine(Age.HasValue);  
  12.    }  
  13. }  
A straightforward illustration showing nullable sorts.
  1. Nullable<bool> male = invalid;  
  2. int? age = invalid;  
There are two courses to proclaim a nullable sort. Either with the Nullable<T> bland structure in which the sort is determined between the edge sections, or we can utilize a question mark after the sort.

In this blog, you have learned about different data types (value type, reference types and nullable types).