照着张老师的写的,我这个运行怎么报错?- public class Test {
- /**
- * @param args
- * @throws NoSuchMethodException
- * @throws SecurityException
- */
- public static void main(String[] args) throws SecurityException, NoSuchMethodException {
- // TODO Auto-generated method stub
- Method applyMethod = Test.class.getMethod("applyVetor",Vector.class);
- Type[] types = applyMethod.getGenericParameterTypes();
- ParameterizedType pType = (ParameterizedType)types[0];
- System.out.println(pType.getRawType());
- System.out.println(pType.getActualTypeArguments()[0]);
- }
- public static void applyVector(Vector<Date> v1){
-
- }
- }
复制代码 |
|