package GenericDemo;import java.lang.reflect.*;
import java.sql.Date;
import java.util.Vector;public class GenericText1 {
public static void main(String[] str) throws Exception{
Method applyMethod=GenericText1.class.getMethod("applyVector", Vector.class);
Type[] types=applyMethod.getGenericParameterTypes();
ParameterizedType pType=(ParameterizedType)types[0];
System.out.println(pType);
}
public static void applyVector(Vector<Date> v){
}}泛型类
import java.sql.Date;
import java.util.Vector;public class GenericText1 {
public static void main(String[] str) throws Exception{
Method applyMethod=GenericText1.class.getMethod("applyVector", Vector.class);
Type[] types=applyMethod.getGenericParameterTypes();
ParameterizedType pType=(ParameterizedType)types[0];
System.out.println(pType);
}
public static void applyVector(Vector<Date> v){
}}泛型类
Date 馒头
你(方法)需要个桶,我给你一个装了馒头的桶。。就这样。。