请问老师本节中的@interface 和interface 的区别
来源:3-9 自定义SpringBoot起步依赖stater

慕虎8754231
2020-03-01
视频中老师演示使用“Enable”的方式对“httpClient”进行配置时使用了@interface:
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Import(HttpClientAutoConfiguration.class)
public @interface EnableHttpClient {
}
请问老师,这里的“@interface”跟“interface ”有什么联系呢?我看视频中对这个是一代而过,麻烦老师详细的讲解下,谢谢!
写回答
1回答
-
格鲁
2020-03-15
@interface是注解的定义修饰符,interface是接口定义的修饰符。两个不是同一个东西,注解可以注解到方法、类、字段上,interface一般都需要一个或多个实现类
00
相似问题