什么时候以及为什么使用枚举是有用的?
When and why is it useful to use Enumeration?
什么时候使用 Java class Enumeration
以及为什么使用它有用?
Enumeration
is largely obsolete. Per the Javadoc, it is an interface that generates a series of elements, one at a time. Successive calls to the nextElement
method return successive elements of the series. It is the predecessor to Iterator
其中(根据 Javadoc)
Iterator
takes the place of Enumeration
in the Java Collections Framework.
什么时候使用 Java class Enumeration
以及为什么使用它有用?
Enumeration
is largely obsolete. Per the Javadoc, it is an interface that generates a series of elements, one at a time. Successive calls to the nextElement
method return successive elements of the series. It is the predecessor to Iterator
其中(根据 Javadoc)
Iterator
takes the place ofEnumeration
in the Java Collections Framework.