How to distinguish between iterator and iterable

iterable is a class interface

And iterator is a method in iterable that returns an iterable object

The Collection interface inherits the iterable interface, so all collection classes that implement the Collection interface have an iterator method

Guess you like

Origin blog.csdn.net/m0_55868614/article/details/127714873