3 回答
TA贡献1868条经验 获得超4个赞
(x != 0) & (1/x > 1)
<-- this means evaluate (x != 0)
(1/x > 1)
(x != 0) && (1/x > 1)
<-- this means evaluate (x != 0)
(1/x > 1)
(1/x > 1)
.
exprA | exprB
<-- this means evaluate exprA
exprB
|
.
exprA || exprB
<-- this means evaluate exprA
false
exprB
||
.
TA贡献1835条经验 获得超7个赞
int a = 4;
int b = 7;
System.out.println(a & b); // prints 4
//meaning in an 32 bit system
// 00000000 00000000 00000000 00000100
// 00000000 00000000 00000000 00000111
// ===================================
// 00000000 00000000 00000000 00000100
TA贡献2041条经验 获得超4个赞
boolean a, b;Operation Meaning Note--------- ------- ---- a && b logical AND short-circuiting a || b logical OR short-circuiting a & b boolean logical AND not short-circuiting a | b boolean logical OR not short-circuiting a ^ b boolean logical exclusive OR !a logical NOTshort-circuiting (x != 0) && (1/x > 1) SAFE not short-circuiting (x != 0) & (1/x > 1) NOT SAFE
添加回答
举报