Search Interview Questions | Click here and help us by providing the answer. Click Correct / Improve and please let us know. |
|
|||
|
| ||||
| Interview Questions and Answers | ||||
| ||||
| Ans. String str = "I had been saying that he had been there"; Map<String,Long> countWords = Arrays.asList(str.split(" ")).stream().filter(p->p.length() = 5).collect(Collectors.groupingBy(p->p,Collectors.counting())); System.out.println(countWords); | ||||
list.stream().collect(Collectors.groupingBy(ClassA::getElement1, Collectors.averagingDouble(ClassA::getelement2))); | ||||
list.stream().collect(Collectors.groupingBy(ClassA::getElement1, Collectors.averagingDouble(ClassA::getElement2))); | ||||