Java, Software Development

Convert a Stream to List in Java 8

So, you’ve been planning to learn the new stuff made available in Java 8. One of them is the Stream interface. Given a collection, e.g., List, a Stream can be extracted using

If you wish not to create an initial list, you may use Stream.of(T... values).

For example,

You Might Also Like