I've defined a class like this:
public class MyClass<T implements MyInterface> {
public T getMy() {
return new T();
}
}
This won't compile. I'm not allowed to create the generic type T.
How can I solve this? Is there any good patterns to do this? Can I solve this by using an abstract class instead of the interface? Do I have to use reflection?