using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { // 装箱 int i = 3; object io = i; Console.WriteLine("i:{0},io:{1}", i, io.ToString()); // 拆箱 int j = (int)io; Console.WriteLine("这是j=" + j); } } }
具体可看:https://www.cnblogs.com/dabiaoge/p/4112581.html
这里不抄录