Assignment 6: Questions
The Collection interface A. implements Iterable interface B. extends Iterable interface C. extends Collections class D. implements Generics interface
B
What type of Collection would we use if we wanted no duplicates? A. List B. Set C. Queue D. Map
B
Which of these packages contain all the Collection classes? A. java.lang B. java.util C. java.net D. java.awt
B
What are we referring to when we mention java.util.Collections.? A. The interface from which lists, queues and sets extend B. The Collections architectural framework C. A utility class for use with objects created from classes that implement the Collection interface D. We never mention this
C
Which of these methods deletes all the elements from the invoking Collection object? A. delete() B. reset() C. clear() D. refresh()
C
What type of Collection does not extend the Collection<E> interface? A. List B. Set C. Queue D. Map
D
T/F? Collections is an interface. Note: Collections is a class; Collection is an interface.
F
T/F? Values of primitive types may be stored directly in a Collection
F
A(n) _______ is used to iterate through a Collection and can remove elements from the Collection during the iteration.
Iterator
T/F? Iterators can remove elements.
T
T/F? There are no direct implementations of the Collection<E> interface?
T
The Collections algorithm (method) ______ determines if two collections have elements in common.
disjoint
An element in a List can be accessed by using the element's _______.
index