1、@override:用于方法,表示该方法重写了父类方法,例如tostring()。
//#2.1 JDK5.0 复写父类方法
class Parent1_2{
public void init(){
}
}
class Son1_2 extends Parent1_2{
@Override
public void init() {
}
}
//#2.2 JDK6.0 实现父接口方法
interface Parent1_3{
public void init();
}
class Son1_3 implements Parent1_3{
@Override
public void init() {
}
}2、@Deprecated:表示该方法已过期,不推荐开发人员使用。
//#1 方法过期
class Parent1_1{
@Deprecated
public void init(){
}
}3、@FunctionalInterface:用于约定函数式接口。
函数式接口:如果界面中只有一种抽象方法(可以包含多种默认方法或多种static方法),则该接口称为函数接口。
@FunctionalInterface
public interface AD {
public void adAttack();
}











