Data types for Java
First, the underlying data type:
It is divided into numerical, character and Boolean types.
Where: Numerical type is divided into integral type, floating point type
Integer: int, accounting for four bytes
Short
Long
Byte
Float type: float: 4 bytes (Float a = 185.2f;)
Double: occupies 8 bytes
Character type: Char: 2 bytes (char a = ' a ';)
Boolean: Boolean: 1 bytes
II. Reference data types
The difference between a reference data type and a base data type is that the reference type stores the address of the referenced object in memory, and the data type is the data;
So comparisons between data types are equal with = =, whereas reference types are best used equals () to compare the actual values of two objects for equality
Common reference data types are classes, interfaces, and arrays, and so on;
The most common is probably a String.
Data types for Java