What is the difference between the Boolean & operator and the && operator

If an expression involving the Boolean & operator is evaluated, both operands areevaluated. Then the & operator is applied to the operand. When an expression involvingthe && operator is evaluated, the first operand is evaluated. If the first operand returns avalue of true then the second operand is evaluated. The && operator is then applied tothe first and second operands. If the first operand evaluates to false, the evaluation of thesecond operand is skipped.

Showing Answers 1 - 4 of 4 Answers

Tracy Nelson

  • Sep 7th, 2005
 

There is no such thing as a "Boolean &" operator. The & operator is the bitwise-AND operator, and combines two values. It's often used for masking off part of a variable (e.g., to get the two low-order bytes of a 32-bit value, use the expression "value & 0xFFFF").

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions