數(shù)據(jù)加載中……
          java1.5注解(二)

          import java.util.Date;
          import java.util.Map;
          import java.util.TreeMap;
          class  SuppressWarningsTest
          {
              
          public static void main(String[] args) 
              
          {
                  Map
          <String,Date> map=new TreeMap<String,Date>();
                  map.put(
          "hello",new Date());
                  System.out.println(map.get(
          "hello"));
              }

          }





          import java.util.Date;
          import java.util.Map;
          import java.util.TreeMap;
          class  SuppressWarningsTest2
          {
              
          public static void main(String[] args) 
              
          {
                  Map map
          =new TreeMap();
                  
          //Map<String,Date> map=new TreeMap<String,Date>();
                  map.put("hello",new Date());
                  System.out.println(map.get(
          "hello"));
              }

          }




          import java.util.Date;
          import java.util.Map;
          import java.util.TreeMap;
          class  SuppressWarningsTest3
          {
              @SuppressWarnings(
          "unchecked")
              
          public static void main(String[] args) 
              
          {
                  Map map
          =new TreeMap();
                  
          //Map<String,Date> map=new TreeMap<String,Date>();
                  map.put("hello",new Date());
                  System.out.println(map.get(
          "hello"));
              }

          }






          import java.util.Date;
          import java.util.Map;
          import java.util.TreeMap;
          class DeprecatedTest 
          {
              
          public void doSomething(){
              System.out.println(
          "guoxinghua");
              }

              
          public static void main(String[] args) 
              
          {
                  DeprecatedTest test
          =new DeprecatedTest();
                  test.doSomething();
                  
              }

          }


          class  SuppressWarningsTest2
          {
              
          public static void main(String[] args) 
              
          {
                  Map map
          =new TreeMap();
                  
          //Map<String,Date> map=new TreeMap<String,Date>();
                  map.put("hello",new Date());
                  System.out.println(map.get(
          "hello"));
              }

          }




          import java.util.Date;
          import java.util.Map;
          import java.util.TreeMap;
          class DeprecatedTest 
          {
              
          public void doSomething(){
              System.out.println(
          "guoxinghua");
              }

              
          public static void main(String[] args) 
              
          {
                  DeprecatedTest test
          =new DeprecatedTest();
                  test.doSomething();
                  
              }

          }


          class  SuppressWarningsTest2
          {
              @SuppressWarnings(
          {"unchecked","deprecation"})
              
          public static void main(String[] args) 
              
          {
                  Map map
          =new TreeMap();
                  
          //Map<String,Date> map=new TreeMap<String,Date>();
                  map.put("hello",new Date());
                  System.out.println(map.get(
          "hello"));
                  DeprecatedTest test
          =new DeprecatedTest();
                  test.doSomething();
              }

          }


          posted on 2008-10-26 00:21 郭興華 閱讀(366) 評論(0)  編輯  收藏


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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 巫溪县| 徐汇区| 久治县| 宜丰县| 广平县| 阿拉善左旗| 九台市| 万年县| 阿图什市| 芜湖市| 蓬莱市| 文山县| 石泉县| 宿州市| 长治县| 印江| 师宗县| 义马市| 交口县| 留坝县| 华容县| 房产| 鄂州市| 江城| 偃师市| 平利县| 宁化县| 姚安县| 土默特左旗| 改则县| 运城市| 句容市| 营山县| 同仁县| 宁夏| 庐江县| 江西省| 灵璧县| 沾化县| 栾川县| 舟山市|