1// import java.util.Arrays;
2// import java.util.stream.Stream;
3
4String[] array = {"a", "b", "c", "d", "e"};
5
6//Arrays.stream
7Stream<String> stream1 = Arrays.stream(array);
8stream1.forEach(x -> System.out.println(x));
9
10//Stream.of
11Stream<String> stream2 = Stream.of(array);
12stream2.forEach(x -> System.out.println(x));
13
1// creating stream from array
2int[] arr = {1, 2, 3, 4};
3
4Arrays.stream(arr);
5Stream.of(arr); // same as above