氟塑料离心泵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. }  
原文参考自站长网http://www.software8.co/wzjs/java/2517.html

    posted on 2013-01-10 12:32 你爸是李刚 阅读(1212) 评论(1)  编辑  收藏

    评论

    # re: 总结Java会出现"unreachable code"错误的几个例子 2013-01-11 13:26 激光笔礼品

    好复杂的问题哦  回复  更多评论   


    只有注册用户登录后才能发表评论。


    网站导航:
     
    <2013年1月>
    303112345
    6789101112
    13141516171819
    20212223242526
    272829303112
    3456789

    导航

    统计

    常用链接

    留言簿

    随笔档案

    文章档案

    技术网站

    行业网站

    搜索

    最新评论

    阅读排行榜

    评论排行榜

    站长网 氟塑料离心泵 注塑机 液晶广告机