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
no
You'll need some kind of abstract factory of one sort or another to pass the buck to:
interface Factory { E create(); } class SomeContainer { private final Factory factory; SomeContainer(Factory factory) { this.factory = factory; } E createContents() { return factory.create(); } }