Conversions of numeric types : Data Type Cast : Data Type C# Examples


C# Examples » Data Type » Data Type Cast »

 

Conversions of numeric types









    
using  System;

class  MainClass
{
        public  static  void  Main()
        {
                checked
                {
                        uint  value1  =  312;
                        byte  value2  =  (byte)  value1;
                        Console.WriteLine("Value:  {0}",  value2);
                }
        }
}
    
   
  
   



Output

Unhandled Exception: System.OverflowException: Arithmetic operation resulted in an overflow.
   at MainClass.Main()


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Data Type Cast