Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What is the difference between the Boolean & operator and the && operator?
What is the difference between the Boolean & operator and the && operator?
✍: Guest
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.
Operator & has no chance to skip both sides evaluation and && operator does. If asked why, give details as above.
2012-07-03, 2307👍, 0💬
Popular Posts:
What Tools to Use to View HTML Documents? The basic tool you need to view HTML documents is any Web ...
What will be printed as the result of the operation below: main() { int x=5; printf("%d,%d,%d\n",x,x. ..
What are the standard ways of parsing XML document? XML parser sits in between the XML document and ...
What is NullPointerException and how to handle it? When an object is not initialized, the default va...
What’ is the sequence in which ASP.NET events are processed ? Following is the sequence in which the...