java技術博客

          jsp博客
          數據加載中……
          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 郭興華 閱讀(361) 評論(0)  編輯  收藏


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


          網站導航:
           
          主站蜘蛛池模板: 肇庆市| 天等县| 新昌县| 云梦县| 唐河县| 合山市| 平山县| 清徐县| 伊宁县| 红桥区| 杂多县| 广饶县| 左权县| 临朐县| 四子王旗| 吉安县| 甘肃省| 黔南| 兴安盟| 阳谷县| 西林县| 南召县| 濮阳市| 寿阳县| 紫阳县| 晋城| 斗六市| 南郑县| 新和县| 武陟县| 察隅县| 新源县| 安国市| 金溪县| 道孚县| 苏尼特右旗| 怀集县| 克东县| 铜鼓县| 鄱阳县| 天台县|