let\'s say I have this simple MyArray class, with two simple methods: add, delete and an iterator. In the main method we can see how it is supposed to be used:
MyArray should implement the Iterator as it is also responsible for maintaining the array. Simple encapsulation principle.