Packing, unpacking operations occur


Popular speaking, is to convert between the basic data types and packaging. Such as: conversion of type int Integer class and
basic data types are converted into packaging containers (such as: int -> Integer).
Packaging is converted into the basic data types unboxing (eg: Integer -> int).
Is a reference to the type of packaging, the basic data type is a value type



By packing and unpacking operations can be set up to do a bridge in value types and reference types. In other words, you can easily implement value types and reference types interchangeable, packing and unpacking can unify inspection system, the ultimate value of any type can be handled in accordance with the object.
Packing - value type into a reference type; unpacking - reference type to the value type.

Guess you like

Origin www.cnblogs.com/zhuyeshen/p/11038892.html