You can implement Iterable.
Here’s an example. It’s not the best, as the object is its own iterator. However it should give you an idea as to what’s going on.
You can implement Iterable.
Here’s an example. It’s not the best, as the object is its own iterator. However it should give you an idea as to what’s going on.