import java.lang.reflect.Type;
import java.util.ArrayList;
import javax.xml.transform.sax.SAXSource;
public class GetGenericSuperclass {
public static void main(String[] args) {
try {
Class< ? super SAXSource> ts = SAXSource.class.getSuperclass();
System.out.println(ts);
} catch (SecurityException e) {
e.printStackTrace();
}
try {
Type t = ArrayList.class.getGenericSuperclass();
System.out.println(t);
} catch (SecurityException e) {
e.printStackTrace();
}
try {
Class[] is = SAXSource.class.getInterfaces();
for(int i=0;i<is.length;i++){
System.out.println(is[i]);
}
} catch (SecurityException e) {
e.printStackTrace();
}
}
}
|