本帖最后由 yuanshilieshou 于 2012-3-25 18:31 编辑
public class GnericText
{
public static void main(String[] args){
Method applyMethod = GnericText.class.getMethod("applyVector",Vector.class);
Type[] types = applyMethod.getGenericParameterTypes();
ParameterizedType pType = (ParameterizedType)types[0];
//1.上面怎么是个数组
//2. copy(new Vector<String>(),new Vector<Date>()) 可以这样写泛型吗
System.out.println(pType.geActualTypeArguments()[0]);
public static void applyVector(Vector<Date> v1){
}
}
}
|