有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java创建方法在ArrayListMultimap中不可用

我正在尝试使用Guava库的MultiMap实现。根据 Guava API Docs它有一个静态的create()方法,但是我的eclipseide认为它没有,即使我已经导入了所需的jar

它表明The method create() is undefined for the type ArrayListMultimap

相同的屏幕截图:

enter image description here


共 (1) 个答案

  1. # 1 楼答案

    因此,Google Collections与Guava不同,尽管它们共享许多相同的类。只有当您使用番石榴罐子而不是google-collections-0.8时,create方法才可用。罐子

    您可以从http://mvnrepository.com/artifact/com.google.guava/guava下载GuavaJAR(任何版本),或者从同一个地方获得Maven/Gradle配置