Csharp/CSharp Tutorial/Data Type/long cast

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Cast int to long implicit and cast in to short explicit

<source lang="csharp">using System; class MainClass {

 static void Main(string[] args)
 {
   int MyInt = 12345;
   long MyLong = MyInt;  
   short MyShort = (short)MyInt;
 }

}</source>