不存在类型变量 V,K 的实例,因此 HashMultiMap<V,K> 符合 MultiMap<..,..>
No instance of type variable V,K exist so that HashMultiMap<V,K> conforms to MultiMap<..,..>
MultiMap<Integer, String> mm = HashMultimap.create();
我在 create()
下看到一条红线说:
"no instance of type variable V,K exist so that HashMultiMap conforms to MultiMap"。
有人可以帮忙吗?我对下一步该做什么进退两难。
检查您的导入和 class/interface 名称:MultiMap
和 HashMultimap
应该从同一个框架导入。
例如 Apache Collections
有 MultiMap
和 Guava
有 Multimap
- 打字错误和导入错误很可能发生。
MultiMap<Integer, String> mm = HashMultimap.create();
我在 create()
下看到一条红线说:
"no instance of type variable V,K exist so that HashMultiMap conforms to MultiMap"。
有人可以帮忙吗?我对下一步该做什么进退两难。
检查您的导入和 class/interface 名称:MultiMap
和 HashMultimap
应该从同一个框架导入。
例如 Apache Collections
有 MultiMap
和 Guava
有 Multimap
- 打字错误和导入错误很可能发生。