3 回答

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

TA貢獻1784條經(jīng)驗 獲得超9個贊
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貢獻1848條經(jīng)驗 獲得超6個贊
int i = 0;if (i = 1){ ...}
- 3 回答
- 0 關(guān)注
- 435 瀏覽
添加回答
舉報