How to sort employee object in java 8 using stream?

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 […]