How do I return an iterator in Java?

Michael

New member
So for my CS program, I implemented an iterator interface into a class called PlaylistIterator. I have a method in another class called Playlist where I need to return a PlaylistIterator object. What's the proper way to do that, I'm having trouble with it? Can I do it all in one line of code?

Hope the question makes sense
Also, in the method where I need to return the PlaylistIterator, the return type has to be of type Iterator, but I need to return a PlaylistIterator object
 
Back
Top