Nested class in Java

Java allows us to define a class that belongs to another class, for example:

Class is defined inside another class, we call it nested class and this other class is called outer class. In my example above, the Builder is a nested class and… Read More

Introduce about text block in Java

Previously, when declaring a multi-line text in Java, for example:

We will usually declare the following:

Result: But from Java 13 onwards, you do not need to declare so anymore. Java now supports the text blocks with the ability to declare multiple lines… Read More

Install Java JDK

To work with the Java programming language, the first thing you need to do is set up the environment to run the application with the Java JDK. In this article, I will guide you through the steps to install Java JDK! To install Java JDK,… Read More

Use Lambda Expression to sort elements of a List in Java

Normally, before Java 8, when we want to sort the elements of a List in Java, we will use the Comparator object. Eg:

Result: From Java 8 onwards, we have another way of doing this. That is, using the sort() method of the List… Read More