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

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

Q.42Medium

What is the difference between Iterator and ListIterator?

Q.43Medium

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

Q.44Medium

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

Q.45Medium

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

Q.46Medium

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

Q.47Hard

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

Q.48Hard

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

Q.49Hard

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

Q.50Hard

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

Q.51Hard

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

Q.52Hard

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

Q.53Hard

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

Q.54Easy

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

Q.55Easy

What is the underlying data structure of HashMap in Java?

Q.56Easy

Which of the following maintains insertion order in Java?

Q.57Medium

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

Q.58Medium

What is the difference between ArrayList and Vector?

Q.59Medium

Which method of PriorityQueue returns the element without removing it?

Q.60Medium

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