Java Class getAnnotatedInterfaces() 方法

2025 年 3 月 21 日 | 阅读 2 分钟

Java Class 类的 getAnnotatedInterfaces() 方法返回一个 AnnotatedType 类型的对象数组,该数组表示此(当前类对象)Class 对象所代表的实体使用的超接口。

语法

参数

不传递任何参数。

返回值

表示超接口的数组

抛出

不抛出任何异常。

示例 1

输出

Anotated Type :interface java.io.Serializable
Annotations     :[]
Declared Annotations     :[]

示例 2

输出

Annotated Type :interface java.io.Serializable
---------------------------------------------------------------------
Annotations :[@ClassgetAnnotatedInterfaceExample2$FileSystem()]
Declared Annotation :[@ClassgetAnnotatedInterfaceExample2$FileSystem()]
 
下一个主题Java类