Switch Statements

前端 未结 4 706
遇见更好的自我
遇见更好的自我 2021-01-18 22:14

For switch statements, is it possible to change the value of the switch inside the switch statement so that it can jump around to different cases? Ex:

int w          


        
4条回答
  •  耶瑟儿~
    2021-01-18 22:51

    If we do not give break after each case then Java will start executing the statement from matching case and keep on executing statements for following cases as well, until either a break statement is found or switch statements end is encountered.

提交回复
热议问题