装拆箱

装箱:将值类型变为引用类型

引用放在栈上,值放在堆上

int i=100;
object iBoxed = i;


拆箱:将引用类型转换为值类型

int UnBoxing=(int)iBoxed;

首页 我的博客
粤ICP备17103704号