C # main differences between conditions and & and conditions or | in languages,
I will not describe it in detail, but I will give you an analysis based on the case. The details are as follows:
The condition "or" Operator (|) executes the logical "or" Operation of the bool operand, but calculates the second operand only when necessary.
And operator (&) executes the logical and operation of its bool operations, but calculates the second operand only when necessary.
We also need to know that | and & are left-bound logical operators, so let's look at the example below.
Class Program {static void Main (string [] args) {int a = 9; int B = 10; int c = 11; int d = 12; if (d> B | c> B & a> B) {Console. writeLine ("true");} Console. readKey ();}}
Therefore, when the value of d> B is determined to be true, the subsequent part of c> B & a> B will not be computed and will enter the Condition Statement.
We hope to help you to get home.