Why can't I use 'continue' inside a switch statement in Java?

后端 未结 7 402
醉梦人生
醉梦人生 2020-12-10 16:47

Why is it that the following code:

class swi  
{
    public static void main(String[] args)  
    {  
        int a=98;
        switch(a)
        {
                  


        
相关标签:
7条回答
  • 2020-12-10 17:31

    The continue-Statement may be used in loops and not in switch. What you probably want is a break.

    0 讨论(0)
提交回复
热议问题