I have Book
and BookList
classes. BookList
is something like this:
public class BookList
{
private final List<
You need to implement the Iterable interface, which means you need to implement the iterator()
method. In your case, this might look something like this:
public class BookList implements Iterable {
private final List bList = new ArrayList();
@Override
public Iterator iterator() {
return bList.iterator();
}
...
}