21. Collections Flashcards
Although there are different kinds of collections, what particular convenience do they all have in common? (Collections API)
s
Name four methods from the Collection interface? Which collections have these methods?
s
What deficiency arguable exists in the use of interfaces as a means of contractual obligation?
s
What features characterize a collection as being a list?
s
What is the type parameter of a List used for?
s
What order does Lists: List interface: iterator() present the elements in?
s
If we have ArrayList al = new ArrayList(); what type is the object referenced by the variable al - is it ArrayList, List, Collection or Object?
ss
How is Lists: ArrayList collection implemented?
d
For which implementation of Lists will add(index) and remove(index) instance methods be slow, and for which will they be fast?
s
How is LinkedList collection implemented?
s
What features characterize a collection as being a map?
s
What are the type parameters of a Map interface used for?
s
How is the TreeMap collection implemented?
s
Howis the HashMap collection implemented?
d
What features characterize a collection as being a set?
s
What is the type parameter of a Set interface used for?
s
What order does the Sets: Set interface: iterator() present the elements in?
s
If we have HashSet hs = new HashSet(); what type is the object referenced by the variable hs - is it HashSet, Set, Collection or Object?
s
How is the TreeSet collection implemented?
s
What order does Sets: TreeSet: iterator() present the elements in?
s
How is HashSet collection implemented?
s
Name a generic class method that is provided in Collections class. What restrictions are placed on its List method argument?
s
What two abstract methods does this have?
s
What two stages are involved in this?
s