Java assignment operators, comparison operators, logical operators.

1. Assignment operator

=    +=    -=    *=    /=  %=

=: Assignment symbol such as int c1=2;//The output is 2

+=:int c2=1; c2+=3;//c2=c2+3, the output is 4,

The same is true for other assignment symbols.

2. Comparison operators

The result of the comparison operation is boolean type

3. Logical operators

The difference between & and &&

When the left side of the symbol is false, the output result is flase, & continues to perform the operation, && no longer performs the right side operation.

The difference between | and ||

When the left side of the symbol is ture, the output result is ture, | continues to perform the operation, || does not perform the right side operation.

Guess you like

Origin blog.csdn.net/tdongmu/article/details/108108572