1.jdk7 new Features
Use the underscore _ to split the number, you can easily see the number of digits
2. Variables, the essence of which is the most basic storage unit in the program
Type VarName [=value]
3. You can declare multiple variables on a single line, but it is best to
4. Local Variables locally variable
Variables defined inside a method or inside a statement block must be declared and initialized before use
5. Constant final
Can only be initialized once, and is distinguished by uppercase letters, with an underscore to differentiate the word
6. Naming conventions
Variables: First letter lowercase and hump rules, monthsalary, NewAge
Constants: Uppercase letters and underscores
Class Name: initial capitalization and hump rules
7.Java operator
Assignment operator =
Arithmetic operators
+-*%/, two-dollar operator, decimal can also be used to take the remainder
+ +--unary operator
Boolean logical expression, logical AND and or short-circuited, if a value is determined, it is no longer evaluated
&& and
|| Or
! Non -
Bitwise OPERATORS * *
Inverse, bitwise-TO, bitwise, OR, bitwise XOR, left-shift operator, right-shift operator
Extension operators
+ = A+=b a=a+b
-= A-=b A=a-b
8.+ between operands on both sides, as long as one is a string, the entire string is concatenated
9. Ternary operator X? Y:z
The preceding x is a Boolean expression, and if X is true, y is typed, otherwise the Z
10. Operator Precedence
First multiplication and then add and subtract, the expression is preferred to use parentheses to organize
11.eclipse Development environment
12.debug mode
13. Structure
Sequential structure
Select structure
Single selection structure
Dual selection structure
Multi-Select structure If-else if-else
Loop structure
14.switch statements
Equivalent judgment, Switch-case Break-default
15. Enhanced switch: expression result can be a string
16.while do first judgment after execution
Initialization-Conditional judgment-loop body-Iteration
17.do while executing and then judging
Day2 Java Learning Notes