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
Nesta página do site você pode assistir ao vídeo on-line Java Collections - Custom Sorting by Comparator Interface | Java Tutorial Part 1 duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Coding Examples 30 Junho 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 595 vezes e gostou 10 espectadores. Boa visualização!