其他分享
首页 > 其他分享> > in loop structure,whether content after break and continue will be executed?`

in loop structure,whether content after break and continue will be executed?`

作者:互联网

                    while(i<=a.length)
                    {
                        idx=i-1;
                        if(a[idx]>=b[jdx])
                        {
                            missionStatus=true;
                            i++;

                            break;
                            System.out.printf("judge whether content after break will be executed");

                        }
                        else
                        {
                            missionStatus=false;
                            i++;
                            continue;
                            System.out.printf("judge whether content after continue will be executed");

                        }

                    }

then complie,the compiler will report unreachable code

Warrior_Dragon.java:136: error: unreachable statement
							System.out.printf("judge whether content after break will be executed");
							^
Warrior_Dragon.java:144: error: unreachable statement
							System.out.printf("judge whether content after continue will be executed");
							^
2 errors

 

 

so it means the content after break and continue won't be executed

标签:content,executed,whether,after,break,will
来源: https://www.cnblogs.com/lsjava/p/16542403.html