Why do generics boxing and unboxing

You just have to understand that boxing and unboxing when value types and reference types of conversion was happening, called the reference value transfer packing, unpacking, said reference value class revolution. Two types of memory handling mechanisms are different, and therefore can not be directly used to use.
We then return to the topic of the examples you just said, if the parameter constructor test is a reference to the type of operation must occur boxing, value type is not of such operations.
Generics Why will not it, very simple, you have to explicitly specify when specific types of incoming When defining paradigm objects, so of course do not install the operating unpacking the like between the same type, which is why the use of generics You can improve the performance of the important reasons.

Guess you like

Origin www.cnblogs.com/deepalley/p/11530400.html