Today we will try to write a java program to sort Employee object in Ascending and Descending order using java 8 stream. import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; public class Stream { public static void main(String[] args){ List<Employee> empList = new ArrayList<Employee>(); empList.add(new Employee(100,”RAM”,”ram@gmail.com”)); empList.add(new Employee(90,”SHYAM”,”shyam@gmail.com”)); empList.add(new Employee(50,”HANUMAAN”,”hanumaan@gmail.com”)); empList.add(new Employee(40,”GHANSHYAM”,”ghanshyam@gmail.com”)); empList.add(new Employee(30,”RADHA”,”radha@gmail.com”)); empList.add(new […]
Introduction In this post we will discuss everything about Liquibase from initial to broad level. After going through the below article you will in a position to understand Liquibase so come and let’s discuss about it – If you are working on a project where you are frequently getting database update and you need to […]
In order to run any java program you need to setup jdk in your machine first. Today we’ll learn how to setup jdk in your machine. Here we’ll install jdk 20 which the latest as per oracle website. Below are the steps – Download the java development kit from below url for windows https://www.oracle.com/in/java/technologies/downloads/ Go […]