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

Which collection maintains insertion order and also provides thread-safety?

Q.242Medium

What is the difference between Iterator and ListIterator?

Q.243Medium

Consider a scenario: You need a data structure that maintains elements in sorted order and allows fast insertion/deletion. Which is optimal?

Q.244Medium

What exception is thrown by Iterator.next() when there are no more elements?

Q.245Medium

Which method of NavigableSet returns the greatest element strictly less than the given element?

Q.246Medium

What is the output of Collections.frequency(list, null) if list contains null elements?

Q.247Hard

In Java 16+, what feature improved collection performance by allowing value-based classes?

Q.248Hard

What is the behavior when concurrent modification occurs during iteration in ConcurrentHashMap vs HashMap?

Q.249Hard

What is the time complexity of subList() operation in ArrayList?

Q.250Hard

Which stream terminal operation preserves encounter order in parallel streams for Collections?

Q.251Hard

What is the worst-case time complexity of QuickSort when used with Collections.sort()?

Q.252Hard

In a scenario where you need to maintain a mapping with LRU (Least Recently Used) eviction policy, which class should be extended?

Q.253Hard

What does the spliterator() method introduced in Java 8 provide over Iterator?

Q.254Easy

Which interface in Java Collections Framework does not allow duplicate elements?

Q.255Easy

What is the underlying data structure of HashMap in Java?

Q.256Easy

Which of the following maintains insertion order in Java?

Q.257Medium

What is the time complexity of get() operation in TreeMap?

Q.258Medium

What is the difference between ArrayList and Vector?

Q.259Medium

Which method of PriorityQueue returns the element without removing it?

Q.260Medium

What exception is thrown when you try to add a null value to a TreeSet?