Type Inference in Java

Type Inference in Java is a Java Compiler’s ability base on the declaration, the calling to determine the datatype, without explicitly declaring it, reducing redundancy code. For you to understand more, I will take an example as follows. Assuming you are working with the List… Read More

Using flatMap() method of Stream object in Java

When working with Stream in Java, sometime we can have a Stream with datatype of a List, Set or Array of object. For example:

Here, we have List of List of String object and when convert into Stream object, we have Stream of List… Read More

Using Lambda Expression to sort a List in Java

Normally, before Java 8, when we want to sort a List object, we will use Comparator object. For example:

Result: Since Java 8, we have another way to do the sorting a List object. That is: using sort() method in List object with Lambda… Read More