Java Collections MCQs with answers Page - 1

You will find multiple-choice questions (MCQs) related to #Java Collections here. Go through these questions to prepare effectively for your upcoming exams and interviews.

To view the correct answer for any question, simply click the "Show Answer" button.

Have a question to share? Click on "Add Question" to contribute!

A

Admin • 799.53K Points
Coach

Q. Which interface is the root of the Java Collections framework?

  • (A) Map
  • (B) List
  • (C) Collection
  • (D) Iterable

A

Admin • 799.53K Points
Coach

Q. Which of the following allows duplicate elements?

  • (A) Set
  • (B) Map
  • (C) List
  • (D) HashSet

A

Admin • 799.53K Points
Coach

Q. Which implementation class provides a sorted set?

  • (A) HashSet
  • (B) TreeSet
  • (C) LinkedHashSet
  • (D) EnumSet

A

Admin • 799.53K Points
Coach

Q. Which class implements a doubly linked list?

  • (A) ArrayList
  • (B) Vector
  • (C) LinkedList
  • (D) Stack

A

Admin • 799.53K Points
Coach

Q. Which collection class is thread-safe?

  • (A) ArrayList
  • (B) HashMap
  • (C) Vector
  • (D) TreeMap

A

Admin • 799.53K Points
Coach

Q. Which interface extends Collection and represents a sequence of elements?

  • (A) Set
  • (B) List
  • (C) Map
  • (D) Queue

A

Admin • 799.53K Points
Coach

Q. What is the default capacity of an ArrayList in Java?

  • (A) 5
  • (B) 8
  • (C) 10
  • (D) 0

A

Admin • 799.53K Points
Coach

Q. Which class implements the Set interface and does not maintain order?

  • (A) TreeSet
  • (B) LinkedHashSet
  • (C) HashSet
  • (D) SortedSet

A

Admin • 799.53K Points
Coach

Q. Which interface is used to store key-value pairs?

  • (A) Set
  • (B) Map
  • (C) List
  • (D) Queue

A

Admin • 799.53K Points
Coach

Q. Which method is used to add an element to a List?

  • (A) insert()
  • (B) append()
  • (C) add()
  • (D) put()
What's Tag

As you may know, questions are organized under broad categories. Each category can include various types of questions. For example, the "History" category might contain questions about the Revolt of 1857, Shivaji Maharaj, Ancient History, Buddhism, and more.

To further refine this organization, we've introduced tags, which act as sub-categories to group questions more specifically.

Verified users can add tags to any question. If you have any suggestions regarding this system, we'd love to hear from you. Contact Us

Learn More