Eight basic data types in Java
The data type of the integer:
BYTE (byte) 8 bit (bit) 2 ^ 8 = 256-128 ~ 127
Short (16bit) 2 ^ 16 = 65536
int (shaping) 32bit 2 ^ 32
Long Plastic 64bit 2 ^ 64
Note: If an integer is not added to any of the identifiers, then the data of type int is the default.
If you need to represent this data as a long type of data, then you need to add the data followed by L to indicate that L is not case-sensitive, but it is recommended to use uppercase (easy to distinguish) Ljavac compilation does not pass.
Data type of decimal:
float (single-precision floating-point) 32bit Reserved 7-bit decimal place
double (double-precision float) 64bit Preserve 15-bit decimal digits
Note: If a decimal number is not added to any identity, then the decimal number defaults to the double type of data, and if you need to represent a float type, you need to add an F representation after the decimal. F is case-insensitive. Do not add F Javac compilation does not pass.
Boolean data type: Boolean data type only two values, true or False
Boolean 1 bytes or 4 bytes
If you use Boolean to declare a variable of a primitive type, then the variable takes up 4 bytes, and if you use Boolean to declare an array type, then the element of each array takes one byte.
Character type:
Char 2 bytes (16bit)
Eight basic data types in Java