讓人崩潰的程式碼,無法預測的結果

poplarbbs發表於2009-08-12

Integer color = null;
int white = 255 * 255 * 255;
color = false ? white : color;


你猜結果會是怎樣呢?
執行一下看看吧,結果是否讓人崩潰?

Integer color1 = 1000;
int color2 = 1000;
if(color1 == color2) {
System.out.printeln("你沒有瘋。");
}

if(color2 == color1) {
System.out.println("你很正常。");
}


上面程式碼結果又如何呢?
你真的能相信Java嗎?無冕之王真的比草根語言嚴謹嗎?

相關文章