CSharp - Data Types Predefined Type

Introduction

The predefined types in C# have both value types and Reference types.

Value types have

Numeric
    Signed integer (sbyte, short, int, long)
    Unsigned integer (byte, ushort, uint, ulong)
    Real number (float, double, decimal)
Logical (bool)
Character (char)

Reference types have

String (string)
Object (object)

Predefined types in C# alias .Net Framework types in the System namespace.

They are the same as shown in the following code

int i = 5;
System.Int32 i = 5;

Demo

using System;
class MainClass/*  w  w w. j av  a  2  s  .c  o  m*/
{
   public static void Main(string[] args)
   {
      int i = 7;         // 0x7
      bool b = true;     // 0x1
      char c = 'A';      // 0x41
      float f = 0.5f;    // uses IEEE floating-point encoding

      Console.WriteLine(i);
      Console.WriteLine(b);
      Console.WriteLine(c);
      Console.WriteLine(f);

   }
}

Result