jQuery in Action, 3rd edition
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes HashSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "HashSet" Watch "HashSet" New topic


Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
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??
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
HashSet doesn't impose any order as TreeSet does.
For changing the sequence of a List:

SCJP2. Please Indent your code using UBB Code
I agree. Here's the link: http://aspose.com/file-tools
subject: HashSet
It's not a secret anymore!