3 回答

TA貢獻(xiàn)1871條經(jīng)驗(yàn) 獲得超13個(gè)贊
// Probably wrongif (x = 5)
if (x == 5)
if (5 == x)
x=5
Int32
Boolean
.

TA貢獻(xiàn)1784條經(jīng)驗(yàn) 獲得超9個(gè)贊
if(null == myDuck)
class Duck
==
if(myDuck == null)
null
public class myDuck{ public int quacks; static override bool operator ==(myDuck a, myDuck b) { // these will overflow the stack - because the a==null reenters this function from the top again if (a == null && b == null) return true; if (a == null || b == null) return false; // these wont loop if (null == a && null == b) return true; if (null == a || null == b) return false; return a.quacks == b.quacks; // this goes to the integer comparison }}

TA貢獻(xiàn)1848條經(jīng)驗(yàn) 獲得超6個(gè)贊
int i = 0;if (i = 1){ ...}
- 3 回答
- 0 關(guān)注
- 422 瀏覽
添加回答
舉報(bào)