Basic data types
Java is the language of a strong data class
There are 8 basic data types, including:
Integer 4 types Int (4 bytes) short (2 bytes) long (8 bytes) byte (1 bytes)
The range and machine-independent lengths of integers in Java are certain, and do not cause integer overflow across platforms
Float type two double float
The length of the double is twice times the length of the float, the double value but the part is used double, at the time of presentation if the writing 3.24 compiler will be considered double type 3.24F is float type
Floating-point numbers have three special values
Positive Infinity (positive integer divided by 0, the result is positive infinity)
Negative infinity
NaN is not a number, that is, non-numeric (0/0 or negative squared) all non-numeric values are not the same if (X==double.nan) is always false
Double does not actually apply with the case of Prohibition rounding, because double a=2.0-1.1 at this time a=0.8999999999999999
The reason is that a double is a binary representation of a binary that is not an exact representation of 1/10 (decimal means 1/3 has a problem) should be used at this time BigDecimal
Char Type a single character (note some common escape characters) is not a valid Java character can be judged by the correlation method in character
Boolean logic to determine false and true
Variable
Java does not differentiate between declarations and definitions of variables, and variables that declare the same data class in Java also support int i,j; This way, but not advocated.
Java Core Technology Volume 1 basics-First day