9910

          單飛

             :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
          1.關(guān)于接口中聲明的變量

          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 單飛 閱讀(156) 評論(0)  編輯  收藏

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 鹿邑县| 兴业县| 同仁县| 芜湖市| 辽宁省| 民丰县| 新和县| 台州市| 凤山市| 孝义市| 仁化县| 冷水江市| 天水市| 宁蒗| 平陆县| 涿鹿县| 晋中市| 山西省| 南投市| 沙河市| 宽城| 永昌县| 三穗县| 武定县| 濮阳县| 阿坝| 梁平县| 新绛县| 新干县| 县级市| 美姑县| 锦州市| 红原县| 乃东县| 清苑县| 涟水县| 佳木斯市| 上思县| 惠东县| 汕尾市| 封开县|