方法包含(对象)上的 NetBeans 错误不明确
NetBeans Error Ambiguous on Method contains(Object)
谁能帮我解决 NetBeans 8.0.2 中的这个错误?我在 Mac 上使用 Java 1.7。 Eclipse 中没有出现这个错误。 Netbeans 总是告诉我方法 contains(Object)
在 Collection
或 List
中不明确,而我在我的方法中使用 ArrayList
。
reference to contains is ambiguous
both method contains(Object) in Collection and method contains(Object) in List match
----
(Alt-Enter shows hints)
那是……只是……奇怪。 List
继承自 Collection
并覆盖 contains(Object)
方法,该方法在 ArrayList
中实现。这在 Eclipse 中运行良好。
在我看来,NetBeans 中有一个严重的错误。
我建议从头开始重新安装 NetBeans,看看是否能解决问题。
谁能帮我解决 NetBeans 8.0.2 中的这个错误?我在 Mac 上使用 Java 1.7。 Eclipse 中没有出现这个错误。 Netbeans 总是告诉我方法 contains(Object)
在 Collection
或 List
中不明确,而我在我的方法中使用 ArrayList
。
reference to contains is ambiguous
both method contains(Object) in Collection and method contains(Object) in List match
----
(Alt-Enter shows hints)
那是……只是……奇怪。 List
继承自 Collection
并覆盖 contains(Object)
方法,该方法在 ArrayList
中实现。这在 Eclipse 中运行良好。
在我看来,NetBeans 中有一个严重的错误。
我建议从头开始重新安装 NetBeans,看看是否能解决问题。