java 内置注解

public class Demo {

    //重写父类方法
    @Override 
    public String toString()
    {
        return "";
    }
    //表示不建议使用
    @Deprecated
    public static void test001()
    {
        System.out.println("aaa");
    }
    //消除编译器左边的警告
    @SuppressWarnings("all")
    public static void test002()
    {
        List list =new ArrayList();
        List list2 =new ArrayList();
    }

    public static void main(String[] args) {
        Date d=new Date();
        test001();
    }

}

猜你喜欢

转载自blog.51cto.com/14437184/2436567