Which of the following interfaces would be used to implement a class that represents a group (or collection) of objects?

Which of the following interfaces would be used to implement a class that represents a group (or collection) of objects?

a)       Iterator
b)       Speaker
c)       Comparable
d)       MouseListener
e)       KeyListener


Answer:  a.

Explanation:  Iterator is an abstract class allowing the user to extend a given class that implements Iterator by using the features defined there.  These features include being able to store a group of objects and iterate (step) through them.


Enhancing Classes

Learn More Multiple Choice Question :