iterable 接口表示可遍历的对象集合,提供逐个访问元素的方法。步骤:创建 iterable 对象。获取 iterator 对象。遍历集合(使用 hasnext 和 next 方法)。优势:解耦遍历逻辑。提高代码可读性。提供可重用性。 使用 Java 中的 Iterable 接口 Iterab