氟塑料離心泵www.buybeng.com

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

          總結(jié)Java會出現(xiàn)"unreachable code"錯誤的幾個例子

          1. throw關(guān)鍵字

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

          2. return關(guān)鍵字

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

          3. continue關(guān)鍵字

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

          4. break關(guān)鍵字

          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. }  
          原文參考自站長網(wǎng)http://www.software8.co/wzjs/java/2821.html

          以上均會出現(xiàn)編譯錯誤:

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

          評論

          # re: 總結(jié)Java會出現(xiàn)"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();
          }
          }
            回復(fù)  更多評論   


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


          網(wǎng)站導(dǎo)航:
           
          <2014年4月>
          303112345
          6789101112
          13141516171819
          20212223242526
          27282930123
          45678910

          導(dǎo)航

          統(tǒng)計

          常用鏈接

          留言簿

          隨筆檔案

          文章檔案

          技術(shù)網(wǎng)站

          行業(yè)網(wǎng)站

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          站長網(wǎng) 氟塑料離心泵 注塑機 液晶廣告機
          主站蜘蛛池模板: 项城市| 英吉沙县| 金阳县| 温泉县| 达州市| 盐山县| 石屏县| 富阳市| 林州市| 黄陵县| 区。| 剑川县| 乐至县| 翁源县| 柳州市| 娄底市| 建瓯市| 蚌埠市| 西盟| 宝鸡市| 湖南省| 廊坊市| 电白县| 托克托县| 陵川县| 墨竹工卡县| 玛沁县| 新余市| 临潭县| 卢湾区| 邻水| 元氏县| 靖江市| 安乡县| 宣汉县| 兴文县| 邛崃市| 蒙山县| 嘉鱼县| 孝昌县| 岳西县|