Difference between revisions of "Comparator Assignment"
Jump to navigation
Jump to search
(→min) |
|||
Line 4: | Line 4: | ||
==CompareUtils== | ==CompareUtils== | ||
===min=== | ===min=== | ||
+ | <nowiki>public static <E> Optional<E> min(E[] array, Comparator<E> comparator)</nowiki> | ||
==CompareApps== | ==CompareApps== |
Revision as of 16:51, 2 November 2021
Contents
Background
Code To Implement
CompareUtils
min
public static <E> Optional<E> min(E[] array, Comparator<E> comparator)
CompareApps
closestTo
public static Optional<Integer> closestTo(Integer[] values, int target)
youngest
public static Optional<HockeyPlayer> youngest(HockeyPlayer[] players)
mostPoints
public static Optional<HockeyPlayer> mostPoints(HockeyPlayer[] players)