What is the method `hasMoreElements()` in the `Enumeration` interface used for?
`hasMoreElements()` is used to check if there are more elements to iterate through in a collection.
Perfect! You've correctly identified the purpose of `hasMoreElements()`.
Can you explain how `hasNext()` in `Iterator` is similar to `hasMoreElements()` in `Enumeration`?