loading
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;

class MainClass {
  public static void Main (string[] args) {
    
    int i = 123;
    object o = i;  // implicit boxing

    try
    {
        int j = (short)o;  // attempt to unbox

        System.Console.WriteLine("Unboxing OK.");
    }
    catch (System.InvalidCastException e)
    {
        System.Console.WriteLine("{0} Error: Incorrect unboxing.", e.Message);
    }
    
  }
}