June 2018
Beginner
722 pages
18h 47m
English
The following three methods create either empty or single-element Stream objects:
The following code demonstrates the usage of the preceding methods:
Stream.empty().forEach(System.out::println); //prints nothingStream.of(1).forEach(System.out::println); //prints: 1List<String> list = List.of("1 ", "2");//printList1(null); //NullPointerExceptionprintList1(list); //prints: 1 2void printList1(List<String> list){ list.stream().forEach(System. ...
Read now
Unlock full access