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.1Easy

Which interface does HashMap implement in Java Collections Framework?

Q.2Easy

What is the time complexity of get() method in HashMap?

Q.3Easy

Which of the following collections maintains insertion order?

Q.4Easy

What is the difference between ArrayList and LinkedList?

Q.5Easy

Which collection does NOT allow duplicate elements?

Q.6Easy

What is the difference between TreeSet and HashSet in sorting?

Q.7Easy

Which method in Set collection prevents duplicate insertion by returning false?

Q.8Easy

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);

Q.9Easy

Which collection class implements NavigableMap interface?

Q.10Easy

In the context of streams and collections, which method returns a Sequential Stream in Java 8+?

Q.11Easy

Which Collection method was introduced in Java 9 to create immutable collections?

Q.12Easy

Which of the following Collection interfaces does NOT support duplicate elements?

Q.13Easy

What is the default initial capacity of a HashMap in Java?

Q.14Easy

Which collection class is synchronized by default?

Q.15Easy

What does the poll() method return when called on an empty Queue?

Q.16Easy

Which of the following correctly represents the hierarchy of Collection framework?

Q.17Easy

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

Q.18Easy

What is the underlying data structure of HashMap in Java?

Q.19Easy

Which of the following maintains insertion order in Java?

Q.20Easy

What is the primary purpose of the Comparator interface in Collections Framework?

Java Programming MCQs – Free Practice Test | iGET | iGET