public class IntegerWrapper
public int Number { get; set; }
public static void Main()
int number = getNumber();
IntegerWrapper iw = new IntegerWrapper();
int secondNumber = getSecondNumber(iw);
int thirdNumber = iw.Number;
public static int getNumber()
throw new OverflowException();
catch (InvalidCastException e)
catch (OverflowException ex)
public static int getSecondNumber(IntegerWrapper iw)
throw new OverflowException();
catch (InvalidCastException e)
catch (OverflowException ex)