我不太明白的一个小程序
Public   class   continue   with   labeldemo{ 
          Public   static   void   main   (string[]args){ 
                         string   searchMe= "look   for   a   substring   in   me "; 
                         string   substring= "subs "; 
                         booleadn   foundIt=false; 
                         int   max=searchMe.length()-substring.length(); 
                         test: 
                                     for(int   i=0;i <=max;i++){ 
                                     int   n=substring.length(); 
                                     int   i=j; 
                                     int   k=0; 
                                     while(n--!=0){ 
                                                 if(searchMe.charAt(j++)!=substring.charAt(k++)){ 
                                                 continue   test;//跳出FOR循环而不是跳出WHILE循环} 
                                                                            } 
                                     foundIt=true;//跳出整个循环 
                                     break   test; 
                            system.out.println(foundIt? "Found   it ": "Didn 't   fount   it ";) 
                            } 
                      } 
 这是实现子串查询的功能,但是我不明白的是那句foundIt=true那句,如果查找未成功的话是怎么跳过去的呢?我对标签不太了解,C++中没有标签吧???
------解决方案--------------------foundIt=true; 
 这句不是控制循环是否继续,它只是保存循环结束后是否找到了。
------解决方案--------------------C++不太清楚
------解决方案--------------------程序写错了吧,应该是int j=i? 
 如果没有查找成功,是由continue test直接跳过了fondIt=true一句。只有while做完,即查找成功,才会执行fondIt=true一句,则整个算法完成了。
------解决方案--------------------continue with labeldemo有这样的java语法吗?写错了吧 
 continue extends labeldemo 
------解决方案--------------------C++中没有标签de
------解决方案--------------------帮顶
------解决方案--------------------Ding