I have a class containing a static create method.
public class TestClass {
public static <E> TestClass<E> create() {
return new TestClass<E>();
}
}
when I use TestClass.create()
, it can be compiled. But when I use TestClass<String>.create()
, it failed to compile, how to specify the generic?