Hi,
In Dan Chisolm's exam set the answer to the following question
(Comprehensive exam nr. 17, Question 24):
Suppose that you would like to create a new instance of a class
that implements the Set interface, and you would like the new
instance to be initialized with the elements of an existing Set.
If you would like the iteration order of the new Set to be the
same as that of the existing Set, then which concrete implementation
of the Set interface should be used for the new instance?
is
LinkedHashSet, TreeSet is there as an option but NOT
included as part of the answer.
Since TreeSet is sorted, and sorting is a special kind of ordering,
I'd think the iterator should traverse both instances in the same way.
Am I overlooking something here?
Cheers,
Gian Franco