Comparator Interface in Java | Core Java tutorials

Опубликовано: 25 Март 2023
на канале: Learn2Code
13
0

In this video we will learn about Comparator Interface in detail. We will see how to use it with a detailed example.

A comparison function, which imposes a total ordering on some collection of objects. Comparators can be passed to a sort method (such as Collections.sort or Arrays.sort) to allow precise control over the sort order. Comparators can also be used to control the order of certain data structures (such as sorted sets or sorted maps), or to provide an ordering for collections of objects that don't have a natural ordering.
The ordering imposed by a comparator c on a set of elements S is said to be consistent with equals if and only if c.compare(e1, e2)==0 has the same boolean value as e1.equals(e2) for every e1 and e2 in S.


На этой странице сайта вы можете посмотреть видео онлайн Comparator Interface in Java | Core Java tutorials длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Learn2Code 25 Март 2023, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 13 раз и оно понравилось 0 зрителям. Приятного просмотра!