C# Type Casting

We need to convert a data of one type to another type before it is used in arithmetic operations that are called Type Conversion or Type Casting.
In C#, type casting is two types:

  • Implicit Conversions
  • Explicit Conversions
  • Implicit Conversions:

    Implicit Conversions can always be performed without any loss of data.

    short y=50;
    int x=y;  // Implicit Conversions