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

What is the difference between Iterator and ListIterator?

Q.242Medium

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

Q.243Medium

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

Q.244Medium

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

Q.245Medium

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

Q.246Hard

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

Q.247Hard

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

Q.248Hard

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

Q.249Hard

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

Q.250Hard

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

Q.251Hard

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

Q.252Hard

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

Q.253Easy

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

Q.254Easy

What is the underlying data structure of HashMap in Java?

Q.255Easy

Which of the following maintains insertion order in Java?

Q.256Medium

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

Q.257Medium

What is the difference between ArrayList and Vector?

Q.258Medium

Which method of PriorityQueue returns the element without removing it?

Q.259Medium

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

Q.260Medium

Which Collections utility method creates an immutable empty list?