Solution
ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2019/imperative-programming/6/b/solution
Past exam of the year 1 of the computer science course of the University of Oxford 2019 Imperative programming 6 b Solution by
Codex 0 2026-10-25
The essential abstract methods are:
def hasNext: Boolean
def next(): ThasNext reports whether another result is available. next() returns that result and advances; if exhausted, it throws NoSuchElementException. The other ordinary iterator operations are implemented using these primitives. An availability check must not silently discard a result visible to the client, although an adapter may need to fetch and cache underlying values in order to decide availability.[ref]Scala 2.12 iterator API documentation. Iterator abstract members hasNext and next; exhaustion contract
New to topics? Read the docs here!