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
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the below is not a subinterface of Queue?
Correct Answer: Option B — BlockingEnque
Detailed Academic Explanation:
BlockingEnque is the correct answer to “Which of the below is not a subinterface of Queue”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 2 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How to sort elements of ArrayList?
Correct Answer: Option B — Collections.sort(listObj)
Detailed Academic Explanation:
Collections.sort(listObj) is the correct answer to “How to sort elements of ArrayList”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 3 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these packages contain all the collection classes?
Correct Answer: Option B — java.util
Detailed Academic Explanation:
java.util is the correct answer to “Which of these packages contain all the collection classes”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 4 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods can be used to obtain set of all keys in a map?
Correct Answer: Option D — keySet()
Detailed Academic Explanation:
keySet() is the correct answer to “Which of these methods can be used to obtain set of all keys in a map”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 5 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods are member of Remote class?
Correct Answer: Option D — None of the mentioned
Detailed Academic Explanation:
None of the mentioned is the correct answer to “Which of these methods are member of Remote class”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 6 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these method Map class is used to obtain an element in the map having specified key?
Correct Answer: Option B — get()
Detailed Academic Explanation:
get() is the correct answer to “Which of these method Map class is used to obtain an element in the map having specified key”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 7 of 40
★ FPSC
★ PPSC
★ 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?
Correct Answer: Option C — elementCount
Detailed Academic Explanation:
elementCount is the correct answer to “What is the name of a data member of class Vector which is used to store a number of elements in the vector”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 8 of 40
★ FPSC
★ PPSC
★ 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); } }
Correct Answer: Option D — Prints Present Time & Date
Detailed Academic Explanation:
Prints Present Time & Date is the correct answer to “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); } }”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 9 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the worst case complexity of accessing an element in ArrayList?
Correct Answer: Option B — O(1)
Detailed Academic Explanation:
O(1) is the correct answer to “What is the worst case complexity of accessing an element in ArrayList”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 10 of 40
★ FPSC
★ PPSC
★ 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); }
Correct Answer: Option C — Compilation Error
Detailed Academic Explanation:
Compilation Error is the correct answer to “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); }”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 11 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
If large number of items are stored in hash bucket, what happens to the internal structure?
Correct Answer: Option A — The bucket will switch from LinkedList to BalancedTree
Detailed Academic Explanation:
The bucket will switch from LinkedList to BalancedTree is the correct answer to “If large number of items are stored in hash bucket, what happens to the internal structure”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 12 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these standard collection classes implements a dynamic array?
Correct Answer: Option C — ArrayList
Detailed Academic Explanation:
ArrayList is the correct answer to “Which of these standard collection classes implements a dynamic array”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 13 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the default clone of HashSet?
Correct Answer: Option B — Shallow clone
Detailed Academic Explanation:
Shallow clone is the correct answer to “What is the default clone of HashSet”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 14 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the correct method used to insert and delete items from the queue?
Correct Answer: Option B — enqueue and dequeue
Detailed Academic Explanation:
enqueue and dequeue is the correct answer to “What is the correct method used to insert and delete items from the queue”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 15 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these standard collection classes implements all the standard functions on list data structure?
Correct Answer: Option A — Array
Detailed Academic Explanation:
Array is the correct answer to “Which of these standard collection classes implements all the standard functions on list data structure”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 16 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What happens if two threads simultaneously modify TreeSet?
Correct Answer: Option A — ConcurrentModificationException is thrown
Detailed Academic Explanation:
ConcurrentModificationException is thrown is the correct answer to “What happens if two threads simultaneously modify TreeSet”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 17 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the remaining capacity of BlockingQueue whose intrinsic capacity is not defined?
Correct Answer: Option A — Integer.MAX_VALUE
Detailed Academic Explanation:
Integer.MAX_VALUE is the correct answer to “What is the remaining capacity of BlockingQueue whose intrinsic capacity is not defined”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 18 of 40
★ FPSC
★ PPSC
★ 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); } } }
Correct Answer: Option A — Test - 10 Test - 10
Detailed Academic Explanation:
Test - 10 Test - 10 is the correct answer to “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); } } }”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 19 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Where does a new element be inserted in linked list implementation of a queue?
Correct Answer: Option B — Tail of list
Detailed Academic Explanation:
Tail of list is the correct answer to “Where does a new element be inserted in linked list implementation of a queue”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 20 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which class provides thread safe implementation of List?
Correct Answer: Option B — CopyOnWriteArrayList
Detailed Academic Explanation:
CopyOnWriteArrayList is the correct answer to “Which class provides thread safe implementation of List”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 21 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these is the interface of legacy?
Correct Answer: Option B — Enumeration
Detailed Academic Explanation:
Enumeration is the correct answer to “Which of these is the interface of legacy”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 22 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
While finding the correct location for saving key value pair, how many times the key is hashed?
Correct Answer: Option B — 2
Detailed Academic Explanation:
2 is the correct answer to “While finding the correct location for saving key value pair, how many times the key is hashed”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 23 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these package is used for all the text related modifications?
Correct Answer: Option A — java.text
Detailed Academic Explanation:
java.text is the correct answer to “Which of these package is used for all the text related modifications”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 24 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these is a Basic interface that all other interface inherits?
Correct Answer: Option D — Collection
Detailed Academic Explanation:
Collection is the correct answer to “Which of these is a Basic interface that all other interface inherits”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 25 of 40
★ FPSC
★ PPSC
★ 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))); } }
Correct Answer: Option D — false
Detailed Academic Explanation:
false is the correct answer to “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))); } }”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 26 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the below is not an implementation of List interface?
Correct Answer: Option D — SessionList
Detailed Academic Explanation:
SessionList is the correct answer to “Which of the below is not an implementation of List interface”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 27 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these is a method of ListIterator used to obtain index of previous element?
Correct Answer: Option B — previousIndex()
Detailed Academic Explanation:
previousIndex() is the correct answer to “Which of these is a method of ListIterator used to obtain index of previous element”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 28 of 40
★ FPSC
★ PPSC
★ 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); } }
Correct Answer: Option B — [A, D, B, C]
Detailed Academic Explanation:
[A, D, B, C] is the correct answer to “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); } }”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 29 of 40
★ FPSC
★ PPSC
★ 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()); } }
Correct Answer: Option D — [A=1, B=2, C=3]
Detailed Academic Explanation:
[A=1, B=2, C=3] is the correct answer to “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()); } }”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 30 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these method is used to calculate number of bits required to hold the BitSet object?
Correct Answer: Option B — length()
Detailed Academic Explanation:
length() is the correct answer to “Which of these method is used to calculate number of bits required to hold the BitSet object”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 31 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these Exceptions is thrown by remote method?
Correct Answer: Option A — RemoteException
Detailed Academic Explanation:
RemoteException is the correct answer to “Which of these Exceptions is thrown by remote method”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 32 of 40
★ FPSC
★ PPSC
★ 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?
Correct Answer: Option A — True
Detailed Academic Explanation:
True is the correct answer to “When an array is passed to a method, will the content of the array undergo changes with the actions carried within the function”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 33 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these class object has an architecture similar to that of array?
Correct Answer: Option A — Bitset
Detailed Academic Explanation:
Bitset is the correct answer to “Which of these class object has an architecture similar to that of array”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 34 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these method of Array class is used sort an array or its subset?
Correct Answer: Option C — sort()
Detailed Academic Explanation:
sort() is the correct answer to “Which of these method of Array class is used sort an array or its subset”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 35 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these is the interface of legacy is implemented by Hashtable and Dictionary classes?
Correct Answer: Option A — Map
Detailed Academic Explanation:
Map is the correct answer to “Which of these is the interface of legacy is implemented by Hashtable and Dictionary classes”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 36 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these class is used for creating a client for a server-client operations?
Correct Answer: Option C — AddClient.java
Detailed Academic Explanation:
AddClient.java is the correct answer to “Which of these class is used for creating a client for a server-client operations”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 37 of 40
★ FPSC
★ PPSC
★ 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]);; } }
Correct Answer: Option A — 12345
Detailed Academic Explanation:
12345 is the correct answer to “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]);; } }”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 38 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the unique feature of LinkedHashSet?
Correct Answer: Option B — It maintains the insertion order and guarantees uniqueness
Detailed Academic Explanation:
It maintains the insertion order and guarantees uniqueness is the correct answer to “What is the unique feature of LinkedHashSet”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 39 of 40
★ FPSC
★ PPSC
★ 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)); } }
Correct Answer: Option C — true
Detailed Academic Explanation:
true is the correct answer to “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)); } }”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
Question 40 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these class object uses the key to store value?
Correct Answer: Option D — All of the mentioned
Detailed Academic Explanation:
All of the mentioned is the correct answer to “Which of these class object uses the key to store value”. This question is standard in competitive examination syllabi for Collections Framework In Java.
💡Key Conceptual Anchor:Collections Framework In Java
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡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.