結果 : how to avoid nested if-else in java