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

Which interface in Java Collections Framework is used to maintain insertion order while allowing duplicates?

Q.22Easy

What is the time complexity of get() operation in HashMap in average case?

Q.23Easy

Which collection class is synchronized and thread-safe by default?

Q.24Easy

What does the PriorityQueue in Java Collections Framework guarantee?

Q.25Easy

Consider: List<String> list = new ArrayList<>(); list.add("Java"); list.add("Python"); What will list.get(1) return?

Q.26Easy

Which method returns true if the map contains the specified value?

Q.27Easy

Which of the following collections maintains insertion order while allowing fast random access?

Q.28Easy

What will be the output of the following code? Set<Integer> set = new TreeSet<>(); set.add(5); set.add(2); set.add(8); set.add(2); System.out.println(set.size());

Q.29Easy

What will happen when you execute: Map<String, String> map = new HashMap<>(); map.put("key", null); System.out.println(map.get("key"));