Java Collection Framework

Last Updated :
Discuss
Comments

Question 1

Which of the following is NOT a part of the Java Collection Framework?


  • A

    Map

  • B

    Queue

  • C

    Array

  • D

    Set

Question 2

What is the key difference between Collection and Collections?

  • A

    Collection is a class, while Collections is an interface


  • B

    Collection is an interface, while Collections is a utility class


  • C

    Both are interfaces


  • D

    Both are utility classes

Question 3

What is the purpose of the Java Collections Framework?

  • A

    To provide a set of classes for managing memory

  • B

    To provide a unified architecture for managing data collections

  • C

    To handle multithreading

  • D

    To enhance the performance of the JVM

Question 4

What is the purpose of the Collections class in Java?

  • A

    It is used to store data

  • B

    It provides utility methods for collection operations

  • C

    It is a type of collection

  • D

    It replaces ArrayList

Question 5

Which of the following methods is provided by the Collections class in Java?

  • A

    addAll()

  • B

    sort()

  • C

    shuffle()

  • D

    all of the above

Question 6

Which of the following is true about the Collections class in Java?

  • A

    It cannot be inherited

  • B

    It is a subclass of AbstractList

  • C

    It contains static methods for working with collections

  • D

    It provides methods to manipulate a single collection

Question 7

Which of the following interfaces does NOT extend the Collection interface?

  • A

    List

  • B

    Set

  • C

    Map

  • D

    Queue

Question 8

What does the add() method in a Collection return?

  • A

    A boolean value indicating success or failure

  • B

    The added element



  • C

    A reference to the collection itself

  • D

    An index of the added element

Question 9

Which of the following is NOT a valid collection in the Java Collections Framework?

  • A

    Stack

  • B

    Vector

  • C

    Map

  • D

    Tree

Question 10

Which class provides a method to reverse the order of elements in a collection in Java?

  • A

    ArrayList

  • B

    Collections

  • C

    Vector

  • D

    HashSet

There are 10 questions to complete.

Take a part in the ongoing discussion