Sets
[ Home ] [ Up ] [ What is It? ] [ Vector & Enumeration ] [ Collections Interfaces ] [ Algorithms ] [ Sets ] [ Maps ]

 

Set Interface
HashSet Class
SortedSet Interface
TreeSet Class
TreeSet with Comparator

 

Mathematically, a set is a collection of elements each of which has a unique value.  That is, the value of no element in the set duplicates the value of another element in the set.

For example, {1,2,3,4} is a set, because every element is unique.  On the other hand, {a,b,c,d,e,a} is not a set, because there are two elements 'a'.

The Collections framework includes support for such sets.  Here's how...

 

This page was last modified on 02 October, 2007