August fourth week learning experience

This week a seven-hour learning Java

1. Learn to use the steps to use variables: 

First: declare variable, the data type in the application memory space   
is then: assignment data is stored into the corresponding memory space   
last: using variables, retrieve data values from the data type of the variable name;        
variable name = value; data type variable name = value;
Note : first and second steps may be combined                     
 int amount; money = 200; = 200 is equivalent to the Money int;. 8. 

2. constants: Final <data type> <constant name> = <initial value> final double PI = 3.149 .
unary comprising ~ + -!, high priority
(1) the lowest priority is the assignment operator
(2) order of operations by the expression () control (highest priority)
(3) from binding only right to left assignment operator, ternary operator and unary operators
(4) arithmetic operators> relational operators> logical operators
ternary operator: ternary operator int min; min = 5 < ? 75: 7;  
 // conditions? Expression 1: Expression 2 ,. Determination condition 1 is true expression is executed as a false expression is executed 2.
System.out.println (min); min = 10 <10. 7:?. 7;
System.out.println (min);

Operator priority: the highest priority :() lowest priority: =        
priority order! > Arithmetic Operators> Comparison Operators> &&> ||

3. while (): Features: first judgment, then execute do while (): Features: first performed, and then determination.

Guess you like

Origin www.cnblogs.com/sunhongbin/p/11407409.html