Java basic grammar-operators

Operator

Arithmetic operators: +,-,* ,/,%,++,–

String concatenation operator: +

Relational comparison operators:> ,<, >=,<=,==,!=

Logical operators: !,& ,|, &&, ||

Assignment operators: = ,+= ,-=,* =./=

Comparison operator

The difference between "&" and "&&": When
single &, the left side is true or false, and the right side is operated;
when double &, if the left side is true, the right side participates in the operation, if the left side is false, then the right side does not participate in the operation.
The difference between "|" and "||" is the same, || means: when the left side is true, the right side does not participate in the operation.

​ Exclusive OR (^ ): When both left and right are true, the result is false.

Guess you like

Origin blog.csdn.net/m0_46958163/article/details/109136861