我们如何在Java中实现自定义可迭代对象?
An Iterable interface is defined in java.lang package and introduced with Java 5 version. An object that implements this interface allows it to be the target of the "for-each" statement. This for-each loop is used for iterating over arrays and collections. An Iterable interface can also be implemented to create custom behavior.
Syntax
public interface Iterable登录后复制