Object-Oriented Programming · LinkedIn · Easy
Create an iterator for an integer array that exposes hasNext() and next() operations. Requirements hasNext() must indicate whether another array element is available. next() must return the next element in sequence. The iterator receives an array of integers as its input. Example Each call to next() produces the next value, and hasNext() becomes false only after all three values have been consumed. Constraints The array length, n, is at most 10^5. Your implementation should…
Checking your access…