Home > Mobile >  Why in the Android with bitwise or "|" to represent the logic and "& amp; & amp;"
Why in the Android with bitwise or "|" to represent the logic and "& amp; & amp;"

Time:10-02

Please god to solve. Be urgent! Be urgent! Be urgent!

CodePudding user response:

Bit arithmetic and logical operations itself has no associated,

Bit arithmetic to generate a value (int), logic operation is a Boolean value

CodePudding user response:

"|" is "and" for bit operations,
"& amp; & amp;" Is "and", used in logic operation,
Is a different operator

CodePudding user response:

A is a operation, double wrote logic operation

CodePudding user response:

| and & amp; & Doesn't matter hair!

| and | | :
Expressions, a | b | c, ABC will perform
While a | b | | | c, if a is true, BC never executed

& And & amp; & , & amp; & If a fale, behind will not be executed for

| and & amp; Generally used in digital transformation, faster
| | and & amp; & In the logic judgment
  • Related