How do you create an infinite stream?

  1. Stream.infinite()
  2. Stream.generate()
  3. Stream.loop()
  4. Stream.unbounded()
Correct answer Stream.generate()

Explanation

`Stream.generate()` creates an infinite stream using a Supplier.

Update: Admin added a tag on this question

Topics

By Admin · · 25 views