Answers to Self-Review Exercises
a) Iterator
.
b) index.
c) autoboxing.
d) ArrayList
, Vector
.
e) auto-unboxing.
f) shutdown
.
g) synchronized.
a) False. Autoboxing occurs when adding a primitive type to a collection, which means the primitive type is converted to its corresponding type-wrapper class.
b) False. A Set
cannot contain duplicate values.
c) False. A Map
cannot contain duplicate keys.
d) True.
e) False. Collections
is a class; Collection
is an interface.
f) True.
g) True.
h) False. Text files are human readable in a text editor. Binary files might be human readable, but only if the bytes in the file represent ASCII characters.
i) True.
Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.