using System; public class Boxing { static public void Main () { double d = 5;// Pass a double to Square () object o = Square (d); ShowSquare (o);// Pass an int to Square () o = Square (10); ShowSquare (o);// Pass a float to Square () o = Square (2.5F); ShowSquare (o); } static object Square (object o) { if (o is double) return ((double) o * (double) o); if (o is int) return ((int) o * (int) o); return (null); } static public void ShowSquare (object o) { if (Object.Equals (o, null)) Console.WriteLine ("The object is null"); else Console.WriteLine ("The square is " + o); } }