Skip to main content

Collections Framework In Java — Part 2 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Collections Framework In Java — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/40 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 40
★ FPSC ★ PPSC

Which of the below is not a subinterface of Queue?

Question 2 of 40
★ FPSC ★ PPSC

How to sort elements of ArrayList?

Question 3 of 40
★ FPSC ★ PPSC

Which of these packages contain all the collection classes?

Question 4 of 40
★ FPSC ★ PPSC

Which of these methods can be used to obtain set of all keys in a map?

Question 5 of 40
★ FPSC ★ PPSC

Which of these methods are member of Remote class?

Question 6 of 40
★ FPSC ★ PPSC

Which of these method Map class is used to obtain an element in the map having specified key?

Question 7 of 40
★ FPSC ★ PPSC

What is the name of a data member of class Vector which is used to store a number of elements in the vector?

Question 8 of 40
★ FPSC ★ PPSC

What will be the output of the following Java code? import java.util.*; class date { public static void main(String args[]) { Date obj = new Date(); System.out.print(obj); } }

Question 9 of 40
★ FPSC ★ PPSC

What is the worst case complexity of accessing an element in ArrayList?

Question 10 of 40
★ FPSC ★ PPSC

What is the length of the application box made in the following Java program? import java.awt.*; import java.applet.*; public class myapplet extends Applet { Graphic g; g.drawString("A Simple Applet",20,20); }

Question 11 of 40
★ FPSC ★ PPSC

If large number of items are stored in hash bucket, what happens to the internal structure?

Question 12 of 40
★ FPSC ★ PPSC

Which of these standard collection classes implements a dynamic array?

Question 13 of 40
★ FPSC ★ PPSC

What is the default clone of HashSet?

Question 14 of 40
★ FPSC ★ PPSC

What is the correct method used to insert and delete items from the queue?

Question 15 of 40
★ FPSC ★ PPSC

Which of these standard collection classes implements all the standard functions on list data structure?

Question 16 of 40
★ FPSC ★ PPSC

What happens if two threads simultaneously modify TreeSet?

Question 17 of 40
★ FPSC ★ PPSC

What is the remaining capacity of BlockingQueue whose intrinsic capacity is not defined?

Question 18 of 40
★ FPSC ★ PPSC

What will be the output of the following Java code snippet? public class Test { public static void main(String[] args) { Set s = new HashSet(); s.add(new Long(10)); s.add(new Integer(10)); for(Object object : s) { System.out.println("test - "+object); } } }

Question 19 of 40
★ FPSC ★ PPSC

Where does a new element be inserted in linked list implementation of a queue?

Question 20 of 40
★ FPSC ★ PPSC

Which class provides thread safe implementation of List?

Question 21 of 40
★ FPSC ★ PPSC

Which of these is the interface of legacy?

Question 22 of 40
★ FPSC ★ PPSC

While finding the correct location for saving key value pair, how many times the key is hashed?

Question 23 of 40
★ FPSC ★ PPSC

Which of these package is used for all the text related modifications?

Question 24 of 40
★ FPSC ★ PPSC

Which of these is a Basic interface that all other interface inherits?

Question 25 of 40
★ FPSC ★ PPSC

What will be the output of the following Java code? import java.util.*; class hashtable { public static void main(String args[]) { Hashtable obj = new Hashtable(); obj.put("A", new Integer(3)); obj.put("B", new Integer(2)); obj.put("C", new Integer(8)); System.out.print(obj.contains(new Integer(5))); } }

Question 26 of 40
★ FPSC ★ PPSC

Which of the below is not an implementation of List interface?

Question 27 of 40
★ FPSC ★ PPSC

Which of these is a method of ListIterator used to obtain index of previous element?

Question 28 of 40
★ FPSC ★ PPSC

What will be the output of the following Java program? import java.util.*; class Arraylist { public static void main(String args[]) { ArrayList obj = new ArrayList(); obj.add("A"); obj.add("B"); obj.add("C"); obj.add(1, "D"); System.out.println(obj); } }

Question 29 of 40
★ FPSC ★ PPSC

What will be the output of the following Java program? import java.util.*; class Maps { public static void main(String args[]) { TreeMap obj = new TreeMap(); obj.put("A", new Integer(1)); obj.put("B", new Integer(2)); obj.put("C", new Integer(3)); System.out.println(obj.entrySet()); } }

Question 30 of 40
★ FPSC ★ PPSC

Which of these method is used to calculate number of bits required to hold the BitSet object?

Question 31 of 40
★ FPSC ★ PPSC

Which of these Exceptions is thrown by remote method?

Question 32 of 40
★ FPSC ★ PPSC

When an array is passed to a method, will the content of the array undergo changes with the actions carried within the function?

Question 33 of 40
★ FPSC ★ PPSC

Which of these class object has an architecture similar to that of array?

Question 34 of 40
★ FPSC ★ PPSC

Which of these method of Array class is used sort an array or its subset?

Question 35 of 40
★ FPSC ★ PPSC

Which of these is the interface of legacy is implemented by Hashtable and Dictionary classes?

Question 36 of 40
★ FPSC ★ PPSC

Which of these class is used for creating a client for a server-client operations?

Question 37 of 40
★ FPSC ★ PPSC

What will be the output of the following Java program? import java.util.*; class Array { public static void main(String args[]) { int array[] = new int [5]; for (int i = 5; i > 0; i--) array[5 - i] = i; Arrays.sort(array); for (int i = 0; i < 5; ++i) System.out.print(array[i]);; } }

Question 38 of 40
★ FPSC ★ PPSC

What is the unique feature of LinkedHashSet?

Question 39 of 40
★ FPSC ★ PPSC

What will be the output of the following Java program? import java.util.*; class Arraylist { public static void main(String args[]) { ArrayList obj1 = new ArrayList(); ArrayList obj2 = new ArrayList(); obj1.add("A"); obj1.add("B"); obj2.add("A"); obj2.add(1, "B"); System.out.println(obj1.equals(obj2)); } }

Question 40 of 40
★ FPSC ★ PPSC

Which of these class object uses the key to store value?

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →