氟塑料離心泵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 你爸是李剛 閱讀(4809) 評論(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();
          }
          }
            回復  更多評論   


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


          網站導航:
           
          <2013年1月>
          303112345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          導航

          統計

          常用鏈接

          留言簿

          隨筆檔案

          文章檔案

          技術網站

          行業網站

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          站長網 氟塑料離心泵 注塑機 液晶廣告機
          主站蜘蛛池模板: 扶绥县| 积石山| 襄汾县| 汕尾市| 雷波县| 阜城县| 文昌市| 沁源县| 建宁县| 延安市| 博野县| 庐江县| 青川县| 丰都县| 若尔盖县| 大宁县| 泰和县| 金华市| 林州市| 长宁区| 连南| 梁平县| 仪征市| 常山县| 凤台县| 乌什县| 建瓯市| 五家渠市| 田阳县| 漳浦县| 贵南县| 佳木斯市| 东城区| 梅河口市| 哈巴河县| 临漳县| 杭锦旗| 松溪县| 武夷山市| 新宁县| 新邵县|