Check out example codes for "create stream from array java". It will help you in understanding the concepts better.

Code Example 1

// import java.util.Arrays;
// import java.util.stream.Stream;

String[] array = {"a", "b", "c", "d", "e"};

//Arrays.stream
Stream<String> stream1 = Arrays.stream(array);
stream1.forEach(x -> System.out.println(x));

//Stream.of
Stream<String> stream2 = Stream.of(array);
stream2.forEach(x -> System.out.println(x));

Code Example 2

// creating stream from array
int[] arr = {1, 2, 3, 4};

Arrays.stream(arr);
Stream.of(arr); // same as above

Learn ReactJs, React Native from akashmittal.com