Sort list in ascending last name length by implementing the comparator interface through an anonymous class
Advertisements This is from the task: Select Comparator<> as the implemented interface. Inside the anonymous class, override the comparison method, namely compare. To get the last name from a string, split the string on a space using split and take the second part of the split. import java.util.stream.Collectors; public class Practicum { public static void… Read More Sort list in ascending last name length by implementing the comparator interface through an anonymous class