Home » Java » Crazy Java notes: 3.3 types of data classification

Crazy Java notes: 3.3 types of data classification

3.3 types of data classification

Java is a strongly typed language, means that all variables must be declared before use, the specified type variables can only accept type matching value

The basic types of
Boolean type: Boolean 1 bytes of 8 bits, only 1
value type
Integer type:
Byte, short, int, long[1/2/4/8 bytes
Character type char[2 byte unsigned integer type.
Floating point types: float, double[4/8 bytes
2. reference types: a reference to an object, equivalent to a pointer
Empty type
The only value of =null, which can be ignored, the equivalent of a special direct NULL reference type
The statement cannot be converted to a reference type, only, cannot be converted into [] assigned to the basic types of


All expressions and variables will determine the types at compile time
Limit the variable can be assigned values, limit expressions can produce value,
Limit on operation can be performed, to determine the meaning of operation
The source code can be found errors in the compilation process, ensure that the program is more robust.

all numeric data type conversion may be performed, including automatic type conversions and casting