There are eight Java basic data types, and the basic types can be divided into three categories: Character type char, Boolean type Boolean, and numeric type byte,short,int,long,float,double. Numeric types can also be classified as integer-type Byte,short,int,long and floating-point data type float,double. There are no unsigned numeric types in Java, their range is fixed and will not change with their hardware environment or operating system. In fact, there is another data type Void in Java, which also has a corresponding wrapper class java.lang.Void, but we cannot manipulate them directly.
define the simple type, occupy bits number and corresponding wrapper class diagram:
Simple Type |
Boolean |
Byte |
Char |
Short |
Int |
Long |
Float |
Double |
void |
Number of binary digits |
1 |
8 |
16 |
16 |
32 |
64 |
32 |
64 |
-- |
Wrapper class |
Boolean |
Byte |
Character |
Short |
Integer |
Long |
Float |
Double |
Void |
Basic types of benefits: Data storage is relatively simple, efficient operation
The advantages of packaging class: some easy. For example, the element of a collection must be an object type, satisfying the idea that everything in Java is an object
2018-05-10 09:28:59
Java eight Big data types