iGET

Java Programming - MCQ Practice Questions

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

951 questions | 100% Free

Q.201Easy

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

Q.202Easy

Which of the following collections maintains insertion order?

Q.203Easy

What is the difference between ArrayList and LinkedList?

Q.204Medium

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

Q.205Medium

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

Q.206Easy

Which collection does NOT allow duplicate elements?

Q.207Medium

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

Q.208Medium

Which of the following is thread-safe?

Q.209Medium

What does the Comparable interface do in Collections Framework?

Q.210Medium

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

Q.211Easy

What is the difference between TreeSet and HashSet in sorting?

Q.212Hard

Which method throws ConcurrentModificationException when collection is modified during iteration?

Q.213Hard

What is the initial capacity and growth strategy of ArrayList?

Q.214Medium

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.215Medium

Which interface provides sorted ordering in Collections Framework?

Q.216Hard

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

Q.217Medium

Which collection class is synchronized and legacy?

Q.218Easy

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

Q.219Easy

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);

Q.220Medium

Which of the following statements about Queue interface is correct?