Guest
Public paste!

Untitled

By: a guest | Mar 16th, 2010 | Syntax: Java | Size: 0.47 KB | Hits: 42 | Expires: Never
Copy text to clipboard
  1.     public static void main(String[] args) {
  2.  
  3.         List<String> stringList = Arrays.asList("A", "B");
  4.         List<Integer> integerList = Arrays.asList(1, 2);
  5.  
  6.         List<? extends List<? extends Serializable>> listList = Arrays.asList(stringList, integerList);
  7.  
  8.         List<?> list = listList.get(0);
  9.  
  10.         Type type = ((ParameterizedType) list.getClass().getGenericSuperclass()).getActualTypeArguments()[0];
  11.         Class clazz = (Class) type;
  12.        
  13.     }