Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 20. Generic Collections > Answers to Self-Review Exercises

Answers to Self-Review Exercises

20.1
  1. Iterator.

  2. index.

  3. autoboxing.

  4. ArrayList, Vector.

  5. double.

  6. unmodifiable wrapper.

  7. auto-unboxing.

  8. disjoint.

20.2
  1. False. Autoboxing occurs when adding a primitive type to a collection, which means the primitive type is converted to its corresponding type-wrapper class.

  2. False. A Set cannot contain duplicate values.

  3. False. A Map cannot contain duplicate keys.

  4. True.

  5. False. Collections is a class; Collection is an interface.

  6. True.

  7. False. As the load factor increases, fewer slots are available relative to the total number of slots, so the chance of a collision increases.

  8. False. Attempting to insert a null element causes a NullPointerException.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial