氟塑料離心泵www.buybeng.com

          jquery教程http://www.software8.co/wzjs/jquery/

          總結Java會出現"unreachable code"錯誤的幾個例子

          1. throw關鍵字

          Java代碼:  
          1. public void XXX() throws Throwable{  
          2.     throw new Throwable();  
          3.     System.out.println("test");  
          4. }  

          2. return關鍵字

          Java代碼 : 
          1. public void XXX() {  
          2.     return;  
          3.     System.out.println("test");  
          4. }  

          3. continue關鍵字

          Java代碼:  
          1. public void XXX() {  
          2.     for(int i=0; i<10; i++) {  
          3.         continue;  
          4.         System.out.println("test");  
          5.     }  
          6. }  

          4. break關鍵字

          Java代碼:  
          1. public void XXX() {  
          2.     for(int i=0; i<10; i++) {  
          3.         if(i==5) {  
          4.             break;  
          5.             System.out.println("test");  
          6.         }  
          7.     }  
          8. }  

          5. while(true):

          Java代碼:  
          1. public static void XXX() {  
          2.     while(true);  
          3.     System.out.println("when?");  
          4. }  
          原文參考自站長網http://www.software8.co/wzjs/java/2821.html

          以上均會出現編譯錯誤:

          posted on 2013-01-22 17:23 你爸是李剛 閱讀(4808) 評論(1)  編輯  收藏

          評論

          # re: 總結Java會出現"unreachable code"錯誤的幾個例子[未登錄] 2014-04-14 19:28 123

          @Override
          public void actionPerformed(ActionEvent e) {
          if (e.getSource() == btnStart) {
          while(true){}
          btnStart.setEnabled(false);
          start = true;
          x = r.nextInt(38);
          y = r.nextInt(32);
          snackLocation s = new snackLocation();
          s.setX(20);
          s.setY(15);
          list.add(s);
          th = new Thread(this);
          th.start();
          this.requestFocus(true);
          repaint();
          }
          if (e.getSource() == btnStop) {
          System.exit(0);
          }
          if (e.getSource() == btnOK) {
          list.clear();
          score = 0;
          speed = 1;
          btnStart.setEnabled(true);
          start = false;
          dia.setVisible(false);
          repaint();
          }
          }
            回復  更多評論   


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          <2014年4月>
          303112345
          6789101112
          13141516171819
          20212223242526
          27282930123
          45678910

          導航

          統計

          常用鏈接

          留言簿

          隨筆檔案

          文章檔案

          技術網站

          行業網站

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          站長網 氟塑料離心泵 注塑機 液晶廣告機
          主站蜘蛛池模板: 广丰县| 修武县| 沈丘县| 屏边| 兴海县| 广西| 阿勒泰市| 华容县| 永昌县| 姜堰市| 枣强县| 诸暨市| 石首市| 景洪市| 潞西市| 永寿县| 佛冈县| 资中县| 上蔡县| 开封县| 根河市| 固安县| 广灵县| 临潭县| 曲水县| 阜南县| 石河子市| 自治县| 呼和浩特市| 饶阳县| 博罗县| 修武县| 达孜县| 集安市| 安宁市| 伊宁市| 鄂尔多斯市| 湖北省| 安多县| 旬邑县| 朝阳区|