Conversions : Casting Conversions : Data Types C# Source Code


Custom Search

C# Source Code » Data Types » Casting Conversions »

 

Conversions








    



public class NumericTypesConversion
{
    public static void Main()
    {
        // all implicit
        sbyte v = 55;
        short v2 = v;
        int v3 = v2;
        long v4 = v3;
        
        // explicit to "smaller" types
        v3 = (int) v4;
        v2 = (short) v3;
        v = (sbyte) v2;
    }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Data Types
» Casting Conversions