Switch to full style
Java2 codes,problems ,discussions and solutions are here
Post a reply

difference between the Boolean & operator and the &&

Thu Nov 06, 2008 10:09 pm

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



Re: difference between the Boolean & operator and the &&

Thu Nov 06, 2008 10:10 pm

If an expression involving the Boolean & operator is evaluated, both operands are evaluated. Then the & operator is applied to the operand. When an expression involving the && operator is evaluated, the first operand is evaluated. If the first operand returns a value of true then the second operand is evaluated. The && operator is then applied to the first and second operands. If the first operand evaluates to false, the evaluation of the second operand is skipped.

Post a reply
  Related Posts  to : difference between the Boolean & operator and the &&
 C++ Boolean Operations     -  
 Boolean type constant     -  
 Use the boolean compare operators     -  
 Define boolean Class properties     -  
 operator int()     -  
 Using the ? Operator     -  
 What is the % operator     -  
 What is Operator Overloading? !!!     -  
 Sizeof Operator     -  
 operator overloading     -  

Topic Tags

Java Basics