TreeSet metods code example
Example 1: TreeSet
// extrait de la classe TreeSet
public class TreeSet extends AbstractSet
implements SortedSet, Cloneable, java.io.Serializable {
//...
public TreeSet() {
this(new TreeMap());
}
//...
}
Example 2: treeset
TreeSet: Can contain only unique values and it is sorted in ascending order
TreeMap: Can contain only unique keys and keys are sorted in ascending order.