Chapter 3 Operators
The classpath environment variable is used to find the class. Java file s required during compilation.
1. Relational operators
Reference comparison: = is used to determine whether the referenced object (the object's memory address) is the same.
Object comparison: equals (). If the content of the two objects is the same, the equals () function must be overwritten.
&, | ,! It can be used only for Boolean variables.
For example, int I ;! (I <10) // correct! I // wrong
2. Short Circuit
Once the value of the entire expression is clearly determined, the remaining part of the expression is no longer calculated.
For example, test (1) & Test (2) & Test (3). If test (1) returns false, test (2) and test (3) are not executed)
3. >>> unsigned right shift operator
No matter whether the positive or negative values are shifted to the right, only 0 is inserted at the high position.
4. If-Else
Boolean-exp? Value1: value2
4. type conversion Operators
In addition to the boolean type, Java allows you to convert a basic type to any other basic type.
For example, int I; long l = (long) I;
Chapter 4 control Execution Process
1. foreach
Used for arrays and containers. For example, float f [] = new float [10];
For (float X: F)
For (char C: "Hello world! ". Tochararray ())
2. Break and continue are used for the for and while loops.