
Collections
Authored by Yosuva Sirumani
Information Technology (IT)
University
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 20 pts
1. Which interface is the root interface in the Java Collection hierarchy?
A. Collection
B. Map
C. Iterable
D. List
2.
MULTIPLE CHOICE QUESTION
30 sec • 20 pts
2. What is the main difference between ArrayList and LinkedList?
A. ArrayList is thread-safe, LinkedList is not
B. LinkedList allows duplicate elements, ArrayList doesn't
C. ArrayList uses a dynamic array, LinkedList uses nodes
D. LinkedList is faster for indexing
3.
MULTIPLE CHOICE QUESTION
30 sec • 20 pts
3. Which of these classes implements the Set interface?
A. HashMap
B. ArrayList
C. HashSet
D. TreeMap
4.
MULTIPLE CHOICE QUESTION
30 sec • 20 pts
4. Which method is used to remove all elements from a Collection?
A. clear()
B. deleteAll()
C. removeAll()
D. erase()
5.
MULTIPLE CHOICE QUESTION
30 sec • 20 pts
5. What will the following code output?
Set<String> set = new HashSet<>();
set.add("Apple");
set.add("Banana");
set.add("Apple");
System.out.println(set.size());
A. 1
B. 2
C. 3
D. Compilation Error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
6. Which class guarantees that the order of elements will remain the same as inserted?
A. HashSet
B. TreeSet
C. LinkedHashSet
D. PriorityQueue
7.
MULTIPLE CHOICE QUESTION
30 sec • 20 pts
7. What is the output of this code snippet?
Map<String, Integer> map = new HashMap<>();
map.put("A", 100);
map.put("B", 200);
map.put("A", 300);
System.out.println(map.get("A"));
A. 100
B. 200
C. 300
D. Null
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
Test wiedzy: Tablice jednowymiarowe w C++
Quiz
•
10th Grade - University
10 questions
Refresh Python
Quiz
•
University
14 questions
Google sheets
Quiz
•
7th Grade - University
14 questions
Data Structures and Algorithms Quiz
Quiz
•
University
15 questions
Q4. Entity Relationship Modelling
Quiz
•
University
13 questions
Python Programming Quiz
Quiz
•
University
15 questions
Selection Programming_If condition
Quiz
•
8th Grade - University
10 questions
Python Basics Quiz
Quiz
•
8th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Information Technology (IT)
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
5 questions
Poetry Interpretation
Interactive video
•
4th Grade - University
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
15 questions
Review1
Quiz
•
University
15 questions
Pre1
Quiz
•
University