If(flag) 與 if(!flag)

BooleanisMan = true / false ; spa   If(isMan)等價於if(isMan==true)樣式 If(!isMan)等價於if(!isMan==true)background   由於只要是 if() 語句,只有()中的boolean爲true時,才能執行if()語句下面的{},若是爲false時,執行else下面{}; 因此 if(不管什麼樣子的boolean
相關文章
相關標籤/搜索