條件成立執行代碼塊,不成立什麼都不做。
if (條件) { // 成立時執行 }
int score = 95; if (score > 90) { System.out.println("獎勵 iPhone 5S"); }
if (score > 90) System.out.println("獎勵");