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

Which keyword is used to prevent a class from being subclassed in Java?

Q.62Easy

Which interface does HashMap implement in Java Collections Framework?

Q.63Easy

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

Q.64Easy

Which of the following collections maintains insertion order?

Q.65Easy

What is the difference between ArrayList and LinkedList?

Q.66Easy

Which collection does NOT allow duplicate elements?

Q.67Easy

What is the difference between TreeSet and HashSet in sorting?

Q.68Easy

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

Q.69Easy

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

Which collection class implements NavigableMap interface?

Q.71Easy

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

Q.72Easy

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

Q.73Easy

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

Q.74Easy

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

Q.75Easy

Which collection class is synchronized by default?

Q.76Easy

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

Q.77Easy

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

Q.78Easy

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

Q.79Easy

What is the underlying data structure of HashMap in Java?

Q.80Easy

Which of the following maintains insertion order in Java?

Java Programming MCQs – Free Practice Test | iGET | iGET