I am writing a very basic java program that calculates frequency of each word in a sentence so far i managed to do this much
import java.io.*;
class Linked
Count frequency of elements of list in java 8
List list = new ArrayList();
Collections.addAll(list,3,6,3,8,4,9,3,6,9,4,8,3,7,2);
Map frequencyMap = list.stream().collect(Collectors.groupingBy(Function.identity(),Collectors.counting()));
System.out.println(frequencyMap);
Note : For String frequency counting split the string and convert it to list and use streams for count frequency => (Map frequencyMap)*
Check below link