拳击和拆箱的优势 [英] advantage of boxing and unboxing

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

问题描述

你好,


在csharp中装箱和拆箱操作的真正优势是什么?

试过看互联网但却找不到任何文章在它上面。


感谢任何帮助

hi there,,

what is the real advantage of boxing and unboxing operations in csharp?
tried looking ard the internet but couldnt find any articles on it.

appreciate any help

推荐答案

<啊**** *@gmail.com在留言中写道

新闻:11 ********************* @ 14g2000cws.googlegrou ps.com ...
<ah*****@gmail.comwrote in message
news:11*********************@14g2000cws.googlegrou ps.com...

嗨那里,


csharp中装箱和拆箱操作的真正优势是什么?

试图查看互联网,但无法找到任何文章。
hi there,,

what is the real advantage of boxing and unboxing operations in csharp?
tried looking ard the internet but couldnt find any articles on it.



拳击的优势在于你可以传递一个整数作为

对象。拆箱的好处是你可以获得原生整数性能

回来。


Michael

The advantage of boxing is that you can pass, say, an integer around as an
object. The advantage of unboxing is you get you native integer performance
back.

Michael


< a href =mailto:ah ***** @ gmail.com>啊***** @ gmail.com 写道:
ah*****@gmail.com wrote:

在csharp中装箱和拆箱操作的真正优势是什么?

试图查看互联网但无法找到任何文章。
what is the real advantage of boxing and unboxing operations in csharp?
tried looking ard the internet but couldnt find any articles on it.



您可以拥有获取或返回任何类型值的方法。你怎么会实现Reflection的GetField或SetProperty方法而没有

拳击?


其次,你可以拥有数据结构它可以保存任何类型的

值,比如对象[]或1.x'的ArrayList和HashTable。


-


..NET 2.0 for Delphi Programmers
www。 midnightbeach.com/.net

您需要了解的内容。

You can have methods that take or return ANY type of value. How would
you implement Reflection''s GetField or SetProperty methods without
boxing?

Secondarily, you can have data structures that can hold ANY type of
value, like an object[] or 1.x''s ArrayList and HashTable.

--

..NET 2.0 for Delphi Programmers
www.midnightbeach.com/.net
What you need to know.


需要大量资源,所以它应该是最小化。


Robin S.

---------------

< ah*****@gmail.com在留言中写道

news:11 ********************* @ 14g2000cws.googlegrou ps。 com ...
It takes a lot of resources, so it should be minimized.

Robin S.
---------------
<ah*****@gmail.comwrote in message
news:11*********************@14g2000cws.googlegrou ps.com...

嗨那里,


csharp中装箱和拆箱操作的真正优势是什么?

试过看互联网,但找不到任何文章。


感谢任何帮助
hi there,,

what is the real advantage of boxing and unboxing operations in csharp?
tried looking ard the internet but couldnt find any articles on it.

appreciate any help



这篇关于拳击和拆箱的优势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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