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
Which interface does HashMap implement in Java Collections Framework?
What is the time complexity of get() method in HashMap?
Which of the following collections maintains insertion order?
What is the difference between ArrayList and LinkedList?
Which method is used to remove an element from ArrayList while iterating?
What is the load factor in HashMap? What is its default value?
Which collection does NOT allow duplicate elements?
What is the time complexity of add() operation in TreeSet?
Which of the following is thread-safe?
What does the Comparable interface do in Collections Framework?
Which collection is best for frequent insertions and deletions in the middle?
What is the difference between TreeSet and HashSet in sorting?
Which method throws ConcurrentModificationException when collection is modified during iteration?
What is the initial capacity and growth strategy of ArrayList?
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?
Which interface provides sorted ordering in Collections Framework?
What is the worst-case time complexity of HashMap.get() when hash collisions occur?
Which collection class is synchronized and legacy?
Which method in Set collection prevents duplicate insertion by returning false?
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);