Duration: 16:44 minutes
Summary: This is the final video on Generics and Collections. In this final section, we discuss few questions that deals with Sets, Maps, and the Comparable interface. We start with the use of the subset method. We showed when both sets (the original and the subset) will be impacted when we add elements in the range and elements out of range. We also explained the difference between higherKey() and ceilingKey() and their impact on the output. We also went over TreeSets and how it needs to compare its elements in order to sort them. When the elements are basic types (integers, strings…), Java knows how to sort them. But when the elements are types that we create (Employee, Dog…), we need to implements the Comparable (or Comparator) interface to help the TreeSet in determining how we want out types to be sorted.