Implementation of iterator pattern for any array of elements
I have two points for improvement:


Right now next() method increments the index. What happens if someone calls next() without calling hasNext() method?


Take care of ArrayIndexOutOfBoundsException or increment the index carefully.

You could implement remove() method (Optional)