Is it possible to get the type of a generic parameter?
An example:
public final class Voodoo {
public static void chill(List> aListWithTy
Nope, that is not possible. Due to downwards compatibility issues, Java's generics are based on type erasure, i.a. at runtime, all you have is a non-generic List
object. There is some information about type parameters at runtime, but it resides in class definitions (i.e. you can ask "what generic type does this field's definition use?"), not in object instances.