usage of api documented as @since 1.8+
时间: 2023-04-28 13:01:00 浏览: 78
@since 1.8+ 的 API 文档用法是指该 API 在 Java 1.8 及以上版本中可用。这意味着如果您的应用程序需要运行在 Java 1.8 或更高版本上,您可以使用这个 API。但如果您的应用程序需要运行在低于 Java 1.8 的版本上,您就不能使用这个 API。
相关问题
JAVA元注解@interface详解(@Target,@Documented,@Retention,@Inherited)。
元注解是用来描述注解的注解,Java提供了四种元注解,分别是@Target、@Documented、@Retention和@Inherited。
1. @Target注解:用于指定注解的作用范围。常用值包括:
- ElementType.TYPE:用于描述类、接口或枚举类型。
- ElementType.FIELD:用于描述实例变量。
- ElementType.METHOD:用于描述方法。
- ElementType.PARAMETER:用于描述方法参数。
- ElementType.CONSTRUCTOR:用于描述构造函数。
- ElementType.LOCAL_VARIABLE:用于描述局部变量。
- ElementType.ANNOTATION_TYPE:用于描述注解类型。
- ElementType.PACKAGE:用于描述包。
2. @Documented注解:用于指定注解是否出现在javadoc中。
3. @Retention注解:用于指定注解的生命周期。常用值包括:
- RetentionPolicy.SOURCE:注解只存在于源代码中,在编译时会被忽略。
- RetentionPolicy.CLASS:注解会在编译时被保留,但是在运行时会被忽略。
- RetentionPolicy.RUNTIME:注解会在运行时保留,可以通过反射获取注解的信息。
4. @Inherited注解:用于指定子类是否继承父类的注解。
注解是Java语言中的一种语法糖,可以用于给程序元素(类、方法、字段等)添加额外的信息。元注解则是用于描述注解本身的注解,可以更好地控制注解的行为。
@Retention(RetentionPolicy.RUNTIME) @Documented @Inherited
这是Java中的注解,分别是@Retention、@Documented和@Inherited。
- @Retention用于指定注解的生命周期,@Retention(RetentionPolicy.RUNTIME)表示该注解在运行时仍然可用,可以通过反射获取。
- @Documented用于指定注解是否会出现在Java文档中。如果一个注解被@Documented修饰,则它会出现在生成的API文档中。
- @Inherited用于指定注解是否可以被子类继承。如果一个注解被@Inherited修饰,则它可以被子类继承,否则不能被子类继承。
这些注解可以用来给代码添加额外的信息,以便在运行时或文档生成时使用。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)