Basic Data Types in JAVA, JAVA Data Types
Byte: The smallest data type in java.1 byte/8 bits. -128 (2 ^ 7 )~ 127 (2 ^ 7-1), default value 0.
Short: short integer,2 bytes/16 bits, range:-32768 (-- 2 ^ 15 )~ 32767 (2 ^ 15-1), default value 0
Int: integer,4 bytes/32 bits, value range:-2147483648 (-2 ^ 31 )~ 2147483647 (2 ^ 31-1), default value 0
Long: long integer,8 bytes/64-bit,-2 ^ 63 (-2 ^ 63 )~ 2 ^ 63-1 (2 ^ 63-1), default: 0L
Float: float type,4 bytes/32 bits, used to store numbers with decimal points (the difference between double and float type is that the valid decimal point is only 6 ~ 7 digits). The default value is 0.
Double: double Floating Point Type,8 bytes/64-bit, default value 0
Char: character type, single character,2 bytes/16 bits, 0 ('\ u0000 ')~ 65535 ('\ uffff'), the default value is null
Boolean: boolean,1 byte, True or false (only two values, namely true and false). The default value is false.
Small capacity -------------------------------> large capacity
Byte, short, char <int <long <float <double
Byte <short
Byte, char, short, and char do not have implicit conversion, and only forced type conversion can be performed between them.