How can I set generic type? For example:
Class<List<Integer>> asd = List<Integer>.class \\ does not work
May be that is a bit stupid question, but I have never met a code where this thing was done.
In short, what you want is List.class
; the generic types are only available at compile-time, and are "erased" at run-time. There's a brief explanation here: http://docs.oracle.com/javase/tutorial/java/generics/erasure.html
...and a bit more detail here: http://www.artima.com/weblogs/viewpost.jsp?thread=208860
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With