* Must be back before class. Words to Remember:
Double decimal string character character
Integer integer Scanner scanner score Score
Boolean Boolean type True True False
1. Variable three elements:
①: Variable Type
②: Variable Name
③: Variable Value
Eight types of data commonly used in 2.java
Integer type: int (+) long (+) byte (8) Short (16)
Decimal type: Double (64) Double precision Float (32) Single precision
Character type: Char
Boolean Type: Boolean
3.java-Novo operator
① Arithmetic operators:
+ (plus)-(minus) * (multiply)/(except)% (take the remainder operation)
② logical operators:
< (less than) > (greater than) <= (less than or equal) >= (greater than or equal) = = (equal to) = = (not equal to)! =
③ Relational operators:
&& (dual and) | | (double or) (they both have short-circuit effects) & (with) | (OR)! Non-
④ Assignment operators:
=
4. Data type conversions:
① cast: Is a type from a large storage range to a small storage range.
Example code: Double a=10;
int a1= (int) A;
* Attention Issues:
Forcing type conversions usually stores the loss of precision, so use caution
② Automatic conversion: is a type from a small storage range to a large storage range.
Example code: Double a=10;
int a1=a;
* Attention Issues:
When converting between integers, numeric values do not change, and integer types, especially larger integer types, are converted to decimal types.
Due to different storage methods, there may be loss of data accuracy.
Java Junior Development Programmer (Unit II)