简体   繁体   English

在Java中使用Bag

[英]Using Bag in Java

Here , I see that Bag class should be in java.util.Collection but when I try to use it, I get cannot be resolved to a type error. 在这里 ,我看到Bag类应该在java.util.Collection但是当我尝试使用它时,我cannot be resolved to a type错误。

Should I copy+pase this or is there some library missing? 我应该复制+插入此内容还是缺少某些库?

Those are 2 different classes neither of which are part of the JDK. 这些是2个不同的类,它们都不是JDK的一部分。 One is a custom class that needs to be added to the build path whereas the other is part of the Apache Commons library which need to be added to the classpath. 一个是需要添加到构建路径的自定义类 ,而另一个是需要添加到类路径的Apache Commons库的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM