What are the benefits of the Iterator interface in Java?
Why is this interface used? Because it supports the basic operations that would allow a client programmer to iterate over any kind of collection (note: not necessarily a Collection in the Object sense). Why are the methods… not directly coded to the data structure implementation itself? They are, they’re just marked Private so you can’t … Read more