iGET

Java Programming - MCQ Practice Questions

Practice free Java Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

958 questions | 100% Free

Q.201Easy

Which interface does HashMap implement in Java Collections Framework?

Q.202Easy

What is the time complexity of get() method in HashMap?

Q.203Easy

Which of the following collections maintains insertion order?

Q.204Easy

What is the difference between ArrayList and LinkedList?

Q.205Medium

Which method is used to remove an element from ArrayList while iterating?

Q.206Medium

What is the load factor in HashMap? What is its default value?

Q.207Easy

Which collection does NOT allow duplicate elements?

Q.208Medium

What is the time complexity of add() operation in TreeSet?

Q.209Medium

Which of the following is thread-safe?

Q.210Medium

What does the Comparable interface do in Collections Framework?

Q.211Medium

Which collection is best for frequent insertions and deletions in the middle?

Q.212Easy

What is the difference between TreeSet and HashSet in sorting?

Q.213Hard

Which method throws ConcurrentModificationException when collection is modified during iteration?

Q.214Hard

What is the initial capacity and growth strategy of ArrayList?

Q.215Medium

Given: Map<String, Integer> map = new HashMap<>(); map.put("A", 10); map.put("B", 20); map.put("A", 30); What will be the size of map?

Q.216Medium

Which interface provides sorted ordering in Collections Framework?

Q.217Hard

What is the worst-case time complexity of HashMap.get() when hash collisions occur?

Q.218Medium

Which collection class is synchronized and legacy?

Q.219Easy

Which method in Set collection prevents duplicate insertion by returning false?

Q.220Easy

What is the output of LinkedHashMap iteration in the following code? LinkedHashMap<String, Integer> map = new LinkedHashMap<>(); map.put("A", 1); map.put("B", 2); map.put("C", 3); for(String key : map.keySet()) System.out.print(key);