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 collection maintains insertion order and also provides thread-safety?
What is the difference between Iterator and ListIterator?
Consider a scenario: You need a data structure that maintains elements in sorted order and allows fast insertion/deletion. Which is optimal?
What exception is thrown by Iterator.next() when there are no more elements?
Which method of NavigableSet returns the greatest element strictly less than the given element?
What is the output of Collections.frequency(list, null) if list contains null elements?
In Java 16+, what feature improved collection performance by allowing value-based classes?
What is the behavior when concurrent modification occurs during iteration in ConcurrentHashMap vs HashMap?
What is the time complexity of subList() operation in ArrayList?
Which stream terminal operation preserves encounter order in parallel streams for Collections?
What is the worst-case time complexity of QuickSort when used with Collections.sort()?
In a scenario where you need to maintain a mapping with LRU (Least Recently Used) eviction policy, which class should be extended?
What does the spliterator() method introduced in Java 8 provide over Iterator?
Which interface in Java Collections Framework does not allow duplicate elements?
What is the underlying data structure of HashMap in Java?
Which of the following maintains insertion order in Java?
What is the time complexity of get() operation in TreeMap?
What is the difference between ArrayList and Vector?
Which method of PriorityQueue returns the element without removing it?
What exception is thrown when you try to add a null value to a TreeSet?