05 2022 档案
摘要:1、三种基本的Annotaton
@Override : 限定某个方法,是重写父类方法 , 该注解只能用于方法
@Deprecated : 用于表示某个程序元素 ( 类 , 方法等 ) 已过时
@SuppressWarnings : 抑制编译器警告
2、元注解
1. Retention 指定注解的作用范围,三种SOURCE,CLASS,RUNTIME
2. Target 指定注解可以在哪些地方使用
3. Documented 指定该注解是否会在javadoc体现
4. Inherited 子类会继承父类注解
阅读全文
摘要:@Inherited 底层 package java.lang.annotation; /** * Indicates that an annotation type is automatically inherited. If * an Inherited meta-annotation is p
阅读全文
摘要:语法 interface 接口名{ //属性 //方法(1.抽象方法 2.默认实现方法 3.静态方法) } class 类名 implements 接口{ 自己的属性; 自己的方法; 必须实现接口的方法 } 注意:在java7.0之前所有的方法都没有方法体,即都是抽象方法。在java8.0后可以有静
阅读全文