The smallest data type in the Byte:java. 1 bytes /8 bits. -128 (2^7) ~127 (2^7-1), default value 0.
Short: Shorter,2 bytes /16 bits, Range 32768 (--2^15) ~32767 (2^15-1), default value 0
int: integer,4 byte /32 bit, value range 2147483648 ( -2^31) ~2147483647 (2^31-1), default value 0
Long: Length,8 bytes /64 bits, -2^63 ( -2^63) ~2^63-1 (2^63-1), default 0L
float: floating point,4 bytes /32 bits, for storing digits with a decimal point (the difference from a double is that the float type is valid only 6~7 bit), the default value is 0
Double: dual-precision floating-point,8-byte /64-bit, default value 0
Char: Character type, single character,2 bytes /16 bits, 0 (' \u0000 ') ~65535 (' \uffff '), default value NULL
Boolean: boolean,1 bytes , true or False (only two values, that is, true, false), default value False
Small capacity -------------------------------> Large capacity
Byte,short,char << int << long << float << double
byte << Short
There is no implicit conversion between Byte and Char, short and char, and only coercion type conversions can occur between them.
Basic data types in Java