In this video, we will provide custom sorting order for the Java's TreeSet. We do this by implementing the Comparator interface in an external class and handing over that to TreeSet. The video shows custom sorting of the Product class by Product ID in Descending Order using the Comparator Interface. Note, the TreeSet here is the Collection of Product instances.
00:00 Introduction
00:14 Comparator Interface
02:45 Compare Method
08:45 Demo - About Product Class
09:53 Demo - TreeSetNumer Class
10:43 Demo - Implement Comparator Interface
17:25 Demo - Create TreeSet with Comparator
21:27 Demo - See How Custom Sort Works
En esta página del sitio puede ver el video en línea Java Collections - Custom Sorting by Comparator Interface | Java Tutorial Part 1 de Duración hora minuto segunda en buena calidad , que subió el usuario Coding Examples 30 junio 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 595 veces y le gustó 10 a los espectadores. Disfruta viendo!