There are 8 Java basic data types, so just remember. Except that it's all reference type.
First Class: Logical Type Boolean
Type II: Text Char
Type III: Integer (Byte, short, int, long)
Char type accounted for 2 bytes
Short from 32768 to 32767
int from-2147483648 to 2147483647 total 10-bit
Long from 9223372036854775808 to 9223372036854775807 total 19 bits
Class Fourth: Floating-point type (float, double)
In mathematics, 0 to 1 have countless floating-point numbers, and the computer is discrete, so when there are errors, the computer with precision (after a few decimal points to indicate the correct), compared with floating-point a==0.1 is not appropriate, should be a-0.1==0; If a is 0.1, even if there is an error a-0.1== 0 because both a and 0.1 are represented as a computer binary with errors
Article tags: Java basic data types
Java four class eight basic data types