Basic data type:
Boolean, only two values, true or FALSE. Used in logic to judge.
Byte, byte type, one byte, -128~127, not commonly used.
Shorter, short integer, two bytes, -2^15~ (2^15-1), not commonly used.
, int, Integer, four bytes, 32bit, common
, long,, length integer,
float, float, low precision (relative to double)
Double, float type, high precision (relative to float)
Char., character type, two bytes
Char can hold an integer value corresponding to the ASCII code, and the output is automatically converted to the corresponding character, or null if there is no corresponding character.
The data type can be automatically converted from low to high, but a high turn low requires forced type conversions, which can be problematic, such as storage size out of bounds.
The above 8 basic types have their corresponding packaging type, in addition to the int corresponding to the Integer,char corresponding character other wrapper class is the first letter uppercase, such as long corresponding to long.
The base type is stored in the stack, and its corresponding wrapper class is an object that is stored in the heap.
Basic data types of Java learning