装箱和拆箱是什么意思 [英] What is meant by boxing and unboxing

查看:98
本文介绍了装箱和拆箱是什么意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


您能告诉我一些样品的装箱和拆箱吗?

谢谢
M.Dhanasekaran

Hi
Can you Please let me know the boxing and unboxing with some samples

Thanks
M.Dhanasekaran

推荐答案

您是否尝试过搜索它?
http://msdn.microsoft.com/en-us/library/yz2be5wk% 28VS.80%29.aspx [ ^ ]
在C#中装箱和拆箱 [
Have you tried to google it?
http://msdn.microsoft.com/en-us/library/yz2be5wk%28VS.80%29.aspx[^]
Boxing and unboxing in C#[^]


我建​​议阅读.Net上的书.许多书都非常详细地描述了这些概念.
I would recommend reading a book on .Net. Many books describe these concepts in great detail.


我的孩子通常会玩游戏.她在盒子里放了东西,问我猜是什么,Boxing.最后,她打开它并告诉我它是什么,unboxing.现在我们在哪里使用它?参加生日聚会时,他们会收到礼物,而不是特定的礼物.因此,您需要进行拳击.现在在您的编程中考虑它.一样.

装箱和拆箱几乎没有开销.使用重载方法可以避免这种情况.尽管在某些情况下无法避免.

但是,此概念不仅属于c#.这是一个一般概念.

您想要更多技术?看看JF2015与Google的回答和握手.
My kid usually play a game. She put something inside a box and asks me to guess what it is, Boxing. finally she opens it and show me what it is, unboxing. Now where we use it? When going for the birth day party they receive Gifts, not specific gifts. So you need to do a boxing. Now think it in your programming. Just the same.

Boxing and unboxing has little overhead. Using overloaded methods can avoid this. Though in some cases it can''t be avoided.

However this concept not just belong to c#. It is a general concept.

You want more technical? Look at JF2015''s answer and handshake with google.


这篇关于装箱和拆箱是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆