結果 : how to avoid multiple if statements in java