9910

单飞

   :: 首页 :: 联系 :: 聚合  :: 管理
1.关于接口中声明的变量

public interface In {
/*public static final*/ int a = 0;
}
public class TestIn implements In{

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        int i=0;
        TestIn t = new TestIn();
        i = t.a;
        i = In.a;
        i = TestIn.a;
    }

}

2.Exception
public class LException extends Exception{

}

public class HException extends LException{

}
public class TestException {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        try{
            throw new HException();
        }catch(HException ex){
           
        }catch(LException e){
           
        }
    }

}



posted on 2009-01-19 23:54 单飞 阅读(137) 评论(0)  编辑  收藏

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


网站导航: