java enum ArrayList - 这可能吗?
可能的重复:
将枚举类型添加到列表
我有一个枚举类:
public enum MyEnum {
ONE, TWO, THREE;
}
在另一个类中,MyClass.java,我想要有以下
ArrayList<MyEnum> list;
这可能吗?因为我遇到了一些问题。
Possible Duplicate:
Adding enum type to a list
I have an enum class:
public enum MyEnum {
ONE, TWO, THREE;
}
And in another class, MyClass.java, I want to have the following
ArrayList<MyEnum> list;
is this possible? because I'm encountering some issues.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这样做应该没有问题。
这段代码编译得很好:
There should be no problem doing that.
This code compiles fine:
尽管您遇到了“一些问题”,但您实际上不是在寻找EnumSet?
Despite "some issues" you have, aren't you actually looking for an EnumSet?