How to call static method from a generic class?

前端 未结 3 915
既然无缘
既然无缘 2021-01-16 13:46

I have a class containing a static create method.

public class TestClass {

 public static  TestClass create() {
    return new TestClass&l         


        
3条回答
  •  一个人的身影
    2021-01-16 14:19

    Assuming you are asking about specifying the type explicitly in case type inference fails, you can use TestClass.create() (notice how the type is after the . as opposed to before).

提交回复
热议问题