AllInfoHub Logo

AllInfoHub – MCQ Practice

Collections Framework – Multiple Choice Questions (MCQs)

  1. 1. What is the Java Collections Framework?

    • A. A set of interfaces and classes for storing and manipulating groups of objects
    • B. A set of keywords used for object-oriented programming
    • C. A tool for compiling Java code
    • D. A library for graphical user interfaces
  2. 2. What is the root interface of the Java Collections Framework?

    • A. Collection
    • B. List
    • C. Set
    • D. Map
  3. 3. Which interface represents an ordered collection (sequence)?

    • A. Set
    • B. Map
    • C. List
    • D. Queue
  4. 4. Which interface represents a collection that contains no duplicate elements?

    • A. List
    • B. Map
    • C. Set
    • D. Queue
  5. 5. Which interface represents a collection that stores key-value pairs?

    • A. List
    • B. Set
    • C. Map
    • D. Queue
  6. 6. Which interface represents a collection designed for holding elements prior to processing?

    • A. List
    • B. Set
    • C. Map
    • D. Queue
  7. 7. Which of the following classes implements the `List` interface?

    • A. HashSet
    • B. TreeSet
    • C. ArrayList
    • D. HashMap
  8. 8. Which of the following classes implements the `Set` interface?

    • A. ArrayList
    • B. LinkedList
    • C. HashSet
    • D. TreeMap
  9. 9. Which of the following classes implements the `Map` interface?

    • A. ArrayList
    • B. HashSet
    • C. TreeMap
    • D. LinkedList
  10. 10. Which of the following classes implements the `Queue` interface?

    • A. ArrayList
    • B. HashSet
    • C. LinkedList
    • D. TreeMap
  11. 11. What is the difference between `HashSet` and `TreeSet`?

    • A. `HashSet` maintains elements in sorted order
    • B. `TreeSet` maintains elements in insertion order
    • C. `HashSet` is faster but does not guarantee order
    • D. `TreeSet` allows duplicate elements
  12. 12. What is the difference between `HashMap` and `TreeMap`?

    • A. `HashMap` maintains entries in sorted order of keys
    • B. `TreeMap` maintains entries in insertion order
    • C. `HashMap` is faster but does not guarantee order
    • D. `TreeMap` allows duplicate keys