1. Data type: Refers to a set of data and the set of operations that can be performed.
Raw data types in 2.java:
①int
---domain:-2 31 ~ 231
②dounle
---Double-precision real number (64-bit)
---operator: && (with), | | (OR),! (non), ^ (XOR)
③char
---characters (16-bit)
3. Expressions
① Operator Precedence: * and/and% priority higher than + and-; the higher the priority, the earlier the operation.
② logical operator Precedence:! > && > | |
4. Type conversion
Attention:
① If the information is not lost, the value is automatically promoted to the advanced data type, for example: 1+2.5 = 1.0 + 2.5; The answer is 3.5.
② converting a floating-point type to an integer will truncate the fractional part, not rounding, the type conversion in complex expressions can be complex, and you should be careful and use type conversions as much as possible, preferably by using only the same type of literals and variables in the expression.
5. Compare
6. Other primitive types
① a 64-bit integer with its operator lang.
② a 16-bit integer with its operator short.
③ 16-bit characters, and their operators, Char.
④ a 8-bit integer, and its operator, byte.
⑤ a 32-bit single-precision real number and its arithmetic operator, float.
Raw data types and expressions