Logical Type Boolean:
Boolean data can only take a value of true or FALSE, not 0 or 0 instead of true or false, which differs from the C language.
Character Char:
A char-type character occupies two bytes. To express by means of ' ', as ' A '
Integer type (byte, short, int, long):
Byte occupies 1 bytes, from 128 to 127
Short takes 2 bytes, from 32768 to 32767 (about 30,000)
int from 4 bytes,-2147483648, to 2147483647 total 10 bits, general integers by default int type.
Long takes 8 bytes, from 9223372036854775808 to 9223372036854775807 total 19 bits
Floating-point type (float, double):
Java float type defaults to double, if you declare a float variable, you need to add f after the data, such as float fl=3.22f.
Look at the following code:
BYTE by=4by=by+3
This compiles an error because the integer 3 defaults to int, and the int and byte types do not operate on each other. The following modifications can be made
The byte by=4by= (byte) (by+3)//by automatically changes from a byte byte to a four-byte int, and after the operation is completed, a byte cast
"Java" data type