Hi, i think that HashSet doesn't specify any ordering while TreeSet does (as implementing SortedSet). is this correct?? and when we say that ordering may change over time, does that mean that in a program if i have a list then ordering may be different at different point of the program execution? is this so even if we don't change the list contents ever in the program once initialized?? regards maulin.
posted 14 years ago
HashSet doesn't impose any order as TreeSet does. For changing the sequence of a List: Collections.reverse(list) Collections.suffle(list) Collections.sort(list)