Java Introduction to Functional Programming Reduction and Aggregation Infinite Streams

David Lin
David Lin
35,847 Points

Minor bug in video code: companies.get(i-1)

There's a minor bug in the code in the video:

It should be companies.get(i-1), not companies.get(i)

      IntStream.iterate(1, i-> i + pageSize)
      .mapToObj(i -> String.format("%d. %s", i, companies.get(i-1)))
      .limit(numPages)
      .forEach(System.out::println);

1 Answer

Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

Awesome David Lin ! Thanks I've added this to the teacher notes!