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

Posted by abson on Stack Overflow See other posts from Stack Overflow or by abson
Published on 2010-03-26T07:44:21Z Indexed on 2010/03/26 8:13 UTC
Read the original article Hit count: 198

Filed under:

Why is it that

class swi  
{
    public static void main(String[] args)  
    {  
        int a=98;
        switch(a)
        {
            default:{ System.out.println("default");continue;}
            case 'b':{ System.out.println(a); continue;}
            case 'a':{ System.out.println(a);}
        }
        System.out.println("Switch Completed");
    }
}

gives error as: continue outside of loop

© Stack Overflow or respective owner

Related posts about java