Exercise: Making a Custom Iterable

Define a class called Team. A Team object contains the names of members of a sports team.

Make the necessary additions to ensure a Team object is iterable. You should also create a TeamIterator class as part of the process.

Test your iterable class by creating an object and looping through it. And as always, we’ll carry on the discussion on the forum.

You must own this product to join the conversation.