Archive

Frequency of each word in a given string

This a quick tutorial for finding the frequency of each word in given string using java. This is a frequently asked question in interviews. They might ask to write the code in Java or Java 8. Lets see how to write it in Java 8 way first as Java 8 is trending in current market.   Try the above codes and see the result. Thanks for reading!!!!

0
Read More

Predicate in Java 8 and how it works

5 mins might be useful if you spend on this page. This is a quick hands on one of the cool feature of java 8. It is helps to reduce the lot of boiler plate code and focused many runtime implementation using @FunctionalInterface. @FunctionalInterface -> A interface which has only one abstract method. It can contain any number of default and static method. We will be talking about Predicate (shown below). @FunctionalInterface interface Predicate<T> Predicate has one abstract method ->…

0
Read More