As documented in Enumeration
's Javadoc, you should favor the Iterator
interface over Enumeration
.
Iterator
offers a similar contract to Enumeration
with the addition of a method for removal and shorter method names.
public class MyClass implements Enumeration { // Noncompliant /* ... */ }
public class MyClass implements Iterator { // Compliant /* ... */ }