ParameterizedType.getActualTypeArguments() has the following syntax.
Type [] getActualTypeArguments()
In the following code shows how to use ParameterizedType.getActualTypeArguments() method.
//w w w . ja v a2s .co m import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.ArrayList; public class Main { public static void main(String args[]) throws Exception { Type type = StringList.class.getGenericSuperclass(); System.out.println(type); ParameterizedType pt = (ParameterizedType) type; System.out.println(pt.getActualTypeArguments()[0]); } } class StringList extends ArrayList<String> { }
The code above generates the following result.