Mastering Java: The Ultimate Quiz for 'Thinking in Java'

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for your Java exam with our ultimate quiz based on 'Thinking in Java'. Engage with expertly crafted questions that enhance your learning process. Perfect for Java enthusiasts looking to solidify their knowledge!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which of these is not a direct subtype of Collection?

  1. Set

  2. List

  3. Queue

  4. Map

The correct answer is: Map

All of the options are subtypes of Collection except for D Map. A Set is a subtype of Collection because it allows for multiple unique elements to be stored and does not allow for duplicates. A List is a subtype of Collection because it allows for a sequence of elements to be stored and allows for duplicates. A Queue is a subtype of Collection because it stores elements in a first-in, first-out manner. However, a Map is not a subtype of Collection because it does not store elements in a collection-like manner, but rather stores entries in a key-value pair format.