Sets
}A Set is an unordered Collection of unique elements (i.e., no duplicate elements).
}The collections framework containsseveral Set implementations, including HashSet and TreeSet.
}HashSet stores its elements in a hashtable, and TreeSet stores its elements in a tree.
}The collections framework alsoincludes the SortedSet interface (which extends Set)for sets that maintain their elements in sorted order.
}Class TreeSet implements SortedSet.
}TreeSet method headSet gets a subset of the TreeSet in which every element is less than the specified value.
}TreeSet method tailSet gets a subset in which each element is greater than or equal to the specified value.
}SortedSet methods first and last get the smallest and largest elements of the set, respectively.

