Untitled
By: a guest | Mar 16th, 2010 | Syntax:
Java | Size: 0.47 KB | Hits: 42 | 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;
}