daxing123
package annotation;
//注解的认识:annotation(注解),从jdk5.0开始引入,也可以叫有功能的注释
//注解的作用:不是程序本身,但可以对程序做出解释,苦于被其他程序(如编译器)读取,

import java.util.ArrayList;
import java.util.List;

public class Test01 extends Object{
    //@Override 重写的注解 注解以后,方法名不能出错,必需要和超类定义的方法名一致
    @Override
    public String toString() {
        return super.toString();
    }
    //@Deprecate 表示不推荐使用,但可以使用,或者存在更好的方法
    @Deprecated
    public static void test(){
        System.out.println("过时了的方法");
    }
    //镇压警告,可以用在方法或类上面
    @SuppressWarnings("all")
    public void test02(){
        List list=new ArrayList();
    }

    public static void main(String[] args) {
         test();
    }
}

 

分类:

技术点:

相关文章:

  • 2021-11-30
  • 2021-11-20
  • 2022-01-19
  • 2022-03-03
  • 2022-12-23
  • 2022-12-23
  • 2021-05-11
  • 2021-12-16
猜你喜欢
  • 2021-05-28
  • 2021-09-17
  • 2021-06-22
  • 2021-09-07
  • 2022-01-01
  • 2021-09-04
相关资源
相似解决方案