An operator is a special symbol that represents the operation, assignment, and comparison of data in a number of ways:
Arithmetic operators (+ 、— 、*,/,%)
Assignment operators (=, + =,-=,*=,/=,%=)
Relational operators (>,>=,<,<=,!=)
Conditional operators (&&,| |,!) &,|,^)
Bitwise operators (&,|,^,~,>>,<<,<<<,>>>)
My summary:
Logical operators are used to concatenate Boolean expressions that cannot be written as 3<x<6in Java and should be written in x>3 & x<6 .
"&" and "&&" difference: Single and when the left, whether true or false, the right side of the operation; double and when, if the left is true, the right to participate in the operation, if the left is false, then the right side does not participate in the operation.
"|" and "| |" The difference is the same, dual or time, the left is true, the right does not participate in the operation.
" ^ " and "|" The difference is that when both left and right are true ,the "^" result is false.
Operators for Java