Java switch statement multiple cases

前端 未结 13 1098
后悔当初
后悔当初 2020-11-27 14:43

Just trying to figure out how to use many multiple cases for a Java switch statement. Here\'s an example of what I\'m trying to do:

switch (variable)
{
    c         


        
13条回答
  •  春和景丽
    2020-11-27 15:10

    Sadly, it's not possible in Java. You'll have to resort to using if-else statements.

提交回复
热议问题