Java中Interface和@interface的区别

interface:声明一个java的接口

@interface:是用来修饰Annotation的,表示实现了java.lang.annotation.Annotation接口

在我们创建一个自定义Annotation(注解)的时候会使用:

public @interface MyAnnotation {

}

posted @ 2020-07-09 10:53  一条咸狗  阅读(1019)  评论(0编辑  收藏  举报