Java data types and automatic entry box

1.java data types: basic data types (8 types) and the reference data type.

  Basic data types:

Types of boolean byte short char int long float double
Place 1 8 16 16 32 64 32 64
byte   1 2 2 4 8 4 8
range   -2^7~2^7-1 -2^15~2^15-1 -2^15~2^15-1 -2^31~2^31-1 -2^63~2^63-1 -2^31~2^31-1 -2^63~2^63-1

 

  Reference data types:

    (1) Class Type: String

    (2) Interface Type

    (3) an array type

 

2. packaging: Because java is object-oriented, java programming ideas in his book and said: everything is an object, so the formation of packaging, but due to the relatively low efficiency of the packaging, it still retains the basic data types.

    Basic data type corresponds to a wrapper class (int wrapper class Integer, char wrapper classes for Character, others are capitalized), in jdk1.5 is the addition of automatic unpacking and sealing functions.

    Automatic sealing upcoming basic data type to the corresponding packaging.

    Automatic packaging unpacking soon converted to the corresponding basic data types.

 

Guess you like

Origin www.cnblogs.com/spring-effort/p/11563505.html