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 郭兴华 阅读(348) 评论(0)  编辑  收藏


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


网站导航: