Java - 泛型 class 的显式方法调用?

Java - Explicit method call for a generic class?

我正在 udacity 学习免费的 google appengine 编程课程(Developing Scalable Apps In java,顺便说一下,这是一个非常好的 appengine 入门课程)。

在其中一节课中,我学习了这段 java 代码示例:

...
// Iterate over keyStringsToAttend and return a Collection of the
// Conference entities that the user has registered to attend
List< Key<Conference> > keysToAttend = new ArrayList<>();
for ( String keyString : keyStringsToAttend ) {
      keysToAttend.add( Key.<Conference>create( keyString ) );
}
...

我的问题是关于片段中的最后一句话:

Key.<Conference>create( keyString )

语法正确,编译和运行完美,但我只是不明白 create(...) 方法名称之前的 .<Conference> 部分的含义... 你能解释一下这个语法吗?

create方法接受泛型参数,所以传递的是参数类型。

您可以阅读有关通用参数的更多信息here