At the bottom, the data in Java is manipulated by operators.
3.1 Simpler Print Statements
Put the SYSTEM.OUT.PRINTLN (x) in a class, and then use the static import method, so that the printing does not have to write so long.
Import static net.mingview.util.print.*; All methods in the Print class are imported statically.
3.2 Using Java Operators
3.3 Priority level
3.4 Assigning values
Underlying type: is a change in value
Object type: is a reference change
3.4.1 The alias problem in a method call
The object type parameter of the incoming method will have an alias, which refers to the reference.
3.5 Arithmetic operators
The arithmetic operators in Java have + 、-、 *,/,%, + =,-=, *=,/=,%=
3.5.11-Yuan plus minus operator
Unary plus minus sign and two plus minus sign use the same symbol, the compiler will automatically judge.
x = (-a);
x = A * (-B);
Parentheses are generally used to make the look more obvious. The unary Plus is just to correspond to a unary minus, and the only effect is to convert the smaller type to int.
3.6 Auto Increment and decrement
' + + ' and '-' have 2 usages, prefixes and suffixes.
The prefix indicates that the re-generated value is calculated first, and the suffix indicates that the value is calculated.
3.7 Relational operators
The operator that can produce a Boolean result is a relational operator.
Includes >, <, >=, <=, = =,! =
Equivalence of 3.7.1 test objects
= = and! = Compares whether the object pointed to by the reference is the same, or true, otherwise false.
The Equals () method can be used by replication to compare content.
3.8 Logical operators
&& and, | | Or,! A Boolean value can not be generated
Java Programming Ideas: 3rd Chapter operator