Invoking statically imported method with explicit type parameters

后端 未结 5 1905
梦毁少年i
梦毁少年i 2021-01-03 20:03

This is the follow up of my question here: Weird Java generic.

If I have a code like this:

Casts. cast(iterable[index]);
<
5条回答
  •  伪装坚强ぢ
    2021-01-03 20:23

    No

    If you want to provide an explicit type parameter when calling a generic static method, you must prefix the method with the class name, even if the method is statically imported.

提交回复
热议问题