Boxing is the encapsulation of the underlying type into a class. For example, when an int is encapsulated into an integer, then you can't think of him as a number, but a class, and the way to do it is to use it.
Unpacking is the conversion of a class to an underlying type. For example, you calculate an addition what is not to use the class, you have to convert it into a basic type,Jdk5 can be converted automatically after the seemingly. Basic types you should know that.
(Byte,short,int,long,float,double,boolean,char)
Byte:java.lang.Byteshort:java.lang.Shortint:java.lang.Integerlong:java.lang.Longfloat:java.lang.Floatdouble : Java.lang.Doublechar:java.lang.Characterboolean:java.lang.Boolean In addition, there are two commonly used packaging classes: BigInteger and BigDecimal in addition, By the way, the basic type of Java occupies the number of bits: 1 bytes is 8 bits, that is, 8bit, note that a byte 8 bits and language independent AH only 8 basic types can be counted. Other reference types are determined by the Java Virtual machine itself cannot manipulate byte 1 bytes short 2 byte int 4 byte long 8 bytes Float 4 byte double 8 byte char 2 byte Boolean 1 byte
A simple explanation of the automatic packing and unpacking of Java