获取类类型变量
//package com.nowjava;/*from N o w J a v a . c o m*/ import java.lang.reflect.TypeVariable; public class Main { public static void main(String[] argv) throws Exception { Class classInstance = String.class; getClassTypeVariable(classInstance); } public static void getClassTypeVariable(Class<?> classInstance) { TypeVariable<?>[] tv; String x; tv = classInstance.getTypeParameters(); //warning: unchecked conversion for (int i = 0; i < tv.length; i++) { x = tv[i].getName(); // E,K,V... if (i == 0) //?//来自 nowjava.com - 时代Java System.out.print("<" + x); else //