Monday, 12 September 2011

What are the differences between boolean & operator and & operator? java interview questions

Ans:


  • When an expression containing the & operator is evaluated, both operands are evaluated.

  • And the & operator is applied to the operand. When an expression containing && operator is evaluated, the first operand is evaluated.


  •  If the first operand returns a value of true then only the second operand is evaluated otherwise the second part will not get executed. && is also called short cut and.

         more questions and answers click here .





No comments: