Too many 'if' statements?

前端 未结 26 1179
天涯浪人
天涯浪人 2020-11-30 16:24

The following code does work how I need it to, but it\'s ugly, excessive or a number of other things. I\'ve looked at formulas and attempted to write a few solutions, but I

26条回答
  •  一生所求
    2020-11-30 16:42

    You may use a switch case instead of mutiple if

    Also to mention that since you have two variables then you have to merge the two variables to use them in switch

    Check this Java switch statement to handle two variables?

提交回复
热议问题