Title: Sets, Maps and Comparable interface - Generics and Collections - Sun Certified Java Programmer 310-065 - Lesson 37
Duration: 16 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.
Methodology of the development of example: Good coding standard and simplified design to prepare for the Java programmer certification exam CX-310-065.
Technology Used: Java - Core Concepts.
Keywords: Class, Object, Integer, String, TreeSet, add(), subset(), pollFirst(), TreeMap, SortedMap, ArrayList, Comparable, Arrays, sort(), implements, binarySearch, Comparator, higherKey, ceilingKey.
Mr.Bool Editor











Post stats:
See the prices for this post in Mr.Bool Credits System below: