Which of the following statements are true?
1) At the root of the collection hierarchy is a class called Collection
2) The collection interface contains a method called enumerator
3) The interator method returns an instance of the Vector class
4) The set interface is designed for unique elements
Answer :
4) The set is designed for unique elements.
Collection is an interface, not a class. The Collection interface includes a method called iterator. This returns an instance of the Iterator class which has some similarities with Enumerators.
The name set should give away the purpose of the Set interface as it is analogous to the Set concept in relational databases which implies uniquness.
No comments:
Post a Comment