Java Class getGenericInterfaces() Method

The getField() method of java Class class returns the Types as an array of the type Type representing the interfaces directly implemented by the class or interface.

Syntax

Parameter

NA

Returns

An array.

Throws

GenericSignatureFormatError, TypeNotPresentException MalformedParameterizedTypeException

Example 1

Test it Now

Output:

No interfaces impleamented...

Example 2

Test it Now

Output:

[Ljava.lang.reflect.Type;@7852e922
type is ParameterizedType
printing each one of ActualTypeArguments:
----
type is Class
class name: String
type is Class
class name: BigInteger
----

Next TopicJava Class




Latest Courses