Mega Code Archive

 
Categories / C# Book / 01 Language Basics
 

0017 Predefined data types

C# defines the following data types: sbyte short int long byte ushort uint ulong float double decimal bool char string sbyte, short, int and long are singed integer type. byte, ushort, unit and ulong are unsigned integer types Predefined C# types have alias in System namespace. For example, the alias for int type is System.Int32 using System; class Program { static void Main(string[] args) { int i = 5; System.Int32 j = 10; Console.WriteLine(i); Console.WriteLine(j); } } The output: 5 10