Besides the type-erasing problem that makes this impossible anyway, you simply cannot guarantee that T has an open constructor without arguments!
The traditional workaround is to pass factory objects that provide methods that you can use to get T objects. A simple example would be
interface Factory<T> { T create(); }
and then your class can get Factory<T> and call create() on it to get more T s. More complex examples may require additional arguments for the create method, for example, or overloading.
Less - pretty workarounds include explicit reflection passing around Class<T> objects. For example, ArrayList.class.newInstance() returns a newly constructed raw ArrayList . You must explicitly pass the Class object, and the reflection-based approach is slower than a regular constructor or factory object (although the speed of reflection has been improving lately). You also depend on a class demonstrating the no-arg constructor, which is not always the case. It can be made to work, but it is never what I would call "enjoyable."
(However, there are links to the fact that the situation may change somewhat in Java 8 using the Lambda project and friends.)
Louis wasserman
source share