getSuperclass 返回直接继承的父类(由于编译擦除,没有显示泛型参数)
getGenericSuperclass 返回直接继承的父类(包含泛型参数)
package cpcn.payment.shwealthbank401.api.domain;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class Test {
public static void main(String[] args) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Shwb4702Response shwb4702Response = new Shwb4702Response();
System.out.println("Student.class.getSuperclass().getSuperclass()\t"
+ shwb4702Response.getClass().getSuperclass().getSuperclass());
System.out.println("Student.class.getGenericSuperclass()\t"