Java How to Program, 11/e Multiple Choice Test Bank 6 of 7
© Copyright 1992-2018 by Deitel & Associates, Inc. and Pearson Education, Inc.
ANS: d. one–to-one.
16.10 Q2: Which statement about hashing is false?
a. Hashing facilitates high-speed storing and retrieval of data.
b. Two different data items can hash to the same cell; this is called a collision.
c. A load factor of 0.5 usually results in good hashing performance, but less efficient utilization of
memory.
d. A load factor of 1.0 usually results in good hashing performance, but less efficient utilization of
memory.
16.10 Q3: Map method ________ is used to determine whether a map contains a mapping for the specified
key. a. containsKey
b. hasKey
c. containsMapping
d. hasMapping
Section 16.11 Synchronized Collections
16.11 Q1: Which statement is false?
a. All built-in collections are synchronized.
b. Concurrent access to a Collection by multiple threads could cause indeterminate results or fatal
errors.
c. To prevent potential threading problems, synchronization wrappers are used around collection
classes that might be accessed by multiple threads.
d. A synchronization wrapper class receives method calls, adds some functionality for thread safety
and then delegates the calls to the wrapped class.
Section 16.12 Unmodifiable Collections
16.12 Q1: Which statement is false?
a. The Collections API provides a set of public static methods for converting collections to
unmodifiable versions.
b. Unmodifable wrappers throw ModificationExceptions if attempts are made to modify the
collection.
c. You can use an unmodifiable wrapper to create a collection that offers read-only access to others
while allowing read-write access to yourself.
d. You can create the kind of collection mentioned in part (c) simply by giving others a reference to the
unmodifiable wrapper while you also retain a reference to the wrapped collection itself.
Section 16.13 Abstract Implementations
16.13 Q1: The collections framework provides various __________ collection interfaces from which the
programmer can quickly “flesh out” complete customized implementations.
a. abstract.
b. concrete.
c. structured.