Java-syntax for explicitly specifying generic arguments in method calls

前端 未结 3 1497
我寻月下人不归
我寻月下人不归 2020-12-05 09:01

What is the syntax for explicitly giving the type parameters for a generic Java method?

3条回答
  •  感情败类
    2020-12-05 09:48

    The following is not the syntax

    genericMethod()
    

    It seems the type arguments must come after a dot as in

    SomeClass.genericMethod()
    this.genericMethod()
    p.genericMethod()
    super.genericMethod()
    SomeClass.super.genericMethod()
    SomeClass.this.genericMethod()
    

提交回复
热议问题