InterviewSolution
| 1. |
What Are Collectors In Java 8? |
|
Answer» COLLECTORS are used to COMBINE the result of processing on the elements of a stream. Collectors can be used to return a list or a string. List<String>strings = Arrays.asList("ABC", "", "bc", "efg", "ABCD","", "JKL"); Collectors are used to combine the result of processing on the elements of a stream. Collectors can be used to return a list or a string. List<String>strings = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl"); |
|