Got an iPhone or iPad? We have a brand new Pastebin App for both devices, and it's totally free! Click here to download the new Pastebin App for iOS.
Guest

Untitled

By: a guest on Mar 16th, 2010  |  syntax: Java  |  size: 0.47 KB  |  hits: 44  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  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.     }