Mega Code Archive

 
Categories / Java / Reflection
 

Get all implemented generic interfaces

import java.lang.reflect.Type; import javax.xml.transform.sax.SAXSource; public class GetGenericInterfaces {   public static void main(String[] args) {     try {       Type[] ts = SAXSource.class.getGenericInterfaces();       for (int i = 0; i < ts.length; i++) {         System.out.println(ts[i]);       }     } catch (SecurityException e) {       e.printStackTrace();     }   } }