Generics of interfaces

Getting the generics of implemented interfaces can be accomplished by calling the getGenericInterfaces() method of the current class:

Type[] interfacesTypes = clazz.getGenericInterfaces();

Further, we call printGenerics() for each Type. Following is the output (there is a single interface, Comparable<Integer>):

Class of type argument: class java.lang.Integer
Simple name of type argument: Integer
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset