
Untitled
By: a guest on Mar 16th, 2010 | syntax:
Java | size: 0.47 KB | hits: 44 | expires: Never
public static void main(String[] args) {
List<String> stringList = Arrays.asList("A", "B");
List<Integer> integerList = Arrays.asList(1, 2);
List<? extends List<? extends Serializable>> listList = Arrays.asList(stringList, integerList);
List<?> list = listList.get(0);
Type type = ((ParameterizedType) list.getClass().getGenericSuperclass()).getActualTypeArguments()[0];
Class clazz = (Class) type;
}