Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added a line for generalizing it to all collections

...

Unfortunately, a Vector and an Enumeration may not always work well together. In fact, the Java API [API 2011] recommends, "New implementations should consider using Iterator in preference to Enumeration.". Consequently, iterable collections should prefer the use of iterators over enumerations.

Noncompliant Code Example

...