Java.util.Optional没有实现Iterable接口是因为它只包含一个值,而Iterable接口是用于表示一组值的集合。因此,Optional不适合实现Iterable接口。如果需要迭代Optional中的值,可以使用ifPresent方法或者使用Java 9中的stream方法。