What are the reasons for not having an index in Java 8 streams?
问题 I was wondering about the Java 8 streams ( Stream<E> ), they have the following methods: forEach(Consumer<? super E> action) forEachOrdered(Consumer<? super E> action) What were the arguments against not supplying the following signature? forEachOrdered(BiConsumer<Integer, ? super E> action) Which would then return the index of the item in the stream and the item itself. With this overload it would be possible to actually use the index in case the stream was ordered. I am really curious to