Home Segments Index Top Previous Next

427: Mainline

A sorted collection is like an ordered collection, except that the order of the elements is determined by what the sorting criterion is, rather than by how the elements are added.

Accordingly, you do not add an element to the front or the back of a sorted collection; instead, you add the element, and the sorted-collection instance takes care of placing the element properly.