posted 17 years ago
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?
This is the question that I am working in a coding way.But i am having trouble.Please help me to figure out.
My coding is
Why should I need to implementn toArray() method? Why this add() method is not working?