예제) checked 형 변환

 

 

 

 

using System;

class TypeCast03

{

  public static void Main()

  {

    int   value3 = 50000;

    try{

  short value4 = checked ((short) value3);//ß(1)

    } catch (Exception e){                    //ß(2)

  Console.WriteLine(“예외 : {0}",e.StackTrace);//ß(3)

    } 

  }

}

 

 

 

 

+ Recent posts