filmov
tv
Sort Employee Objects in Collection By Name | Custom Sorting using Comparator in Java

Показать описание
In this video we will see how to sort objects in a collection by one of properties of that object in Java. The use case we are taking up is that of an Employee class which will have empId, empName and empDept fields and we need to sort a List of Employee objects by empName. This is a case of custom sorting in Java.
I'll show you:
✅ How to sort Employee objects by name
✅ Using Comparator for custom sorting
✅ Refining a big comparator code to a short Lambda Expression
✅ Step-by-step coding with explanation
📌 Perfect for Java beginners & experienced developers!
🔔 Subscribe & hit the bell icon for more Java tutorials!
#Java #Comparator #SortingObjects #JavaProgramming #Coding
I'll show you:
✅ How to sort Employee objects by name
✅ Using Comparator for custom sorting
✅ Refining a big comparator code to a short Lambda Expression
✅ Step-by-step coding with explanation
📌 Perfect for Java beginners & experienced developers!
🔔 Subscribe & hit the bell icon for more Java tutorials!
#Java #Comparator #SortingObjects #JavaProgramming #Coding