Is it possible to create an instance of a generic type in Java? I\'m thinking based on what I\'ve seen that the answer is no
(due to type erasure), but
You can with a classloader and the class name, eventually some parameters.
final ClassLoader classLoader = ...
final Class> aClass = classLoader.loadClass("java.lang.Integer");
final Constructor> constructor = aClass.getConstructor(int.class);
final Object o = constructor.newInstance(123);
System.out.println("o = " + o);