Console. writeline (1 = 1 & 1 = 1); both the first and second judgments are executed. console. writeline (1 = 1 & 1 = 1); if the previous judgment is false, the subsequent judgment is not executed. returns false directly. it is recommended to use & for a reason. for example, TB is a textboxif (TB! = NULL & TB. Text = "") {} If TB! = If the value of null is true, an error occurs when writing this statement because TB is not used! If the value of = NULL is true or false, TB. Text = "" will be executed. If TB = NULL, there will be no TB. Text. If (TB! = NULL & TB. Text = "") {} If TB! = If the value of null is false, the subsequent judgment will not be executed.
Description on msdn:
For integer andBoolThe Type predefines the Binary & operator. For an integer, & the logic of the calculation operand is bitwise "and ". ForBoolOperand, and the logic of the calculated operand "and"; that is, if and only when both operands areTrueThe result isTrue.
&The operator calculates two operators, independent of the value of the first operand.