結果 : how to avoid nested if statements in java