
Java Collections Quiz
Quiz
•
Other
•
University
•
Practice Problem
•
Hard
Niveditha N
Used 1+ times
FREE Resource
Enhance your content in a minute
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which Java collection class is most suitable to represent a shopping cart where items can be accessed by index and duplicates are allowed?
HashSet
HashMap
ArrayList
TreeSet
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In a school attendance system where each student should be marked present only once, which collection would you use?
ArrayList
HashSet
TreeMap
Stack
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You are building a dictionary application where each word maps to its meaning. Which collection is best suited?
LinkedList
Stack
HashMap
TreeSet
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which collection would you use to store a list of students in the order of registration, without allowing duplicates?
TreeMap
LinkedHashSet
PriorityQueue
Hashtable
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following?
List list = new ArrayList<>();
list.add("A"); list.add("B"); list.add("A");
Set set = new HashSet<>(list);
System.out.println(set.size());
2
3
Compilation Error
Runtime Exception
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of this code? List list = new ArrayList<>(); list.add("A"); list.add("B"); list.add(1, "C"); System.out.println(list);
[A, B, C]
[A, C, B]
[C, A, B]
Compilation Error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider this code: List list = Arrays.asList(1, 2, 3, 4, 5); list.set(2, 10); System.out.println(list);
[1, 2, 10, 4, 5]
[1, 10, 3, 4, 5]
Compilation Error
Runtime Exception
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
10 questions
Flags (Hard) Pt.2
Quiz
•
3rd Grade - University
6 questions
Q05. E-MARKETING: PAY PER CLICK ADVERTISING
Quiz
•
University - Professi...
10 questions
ICE Task 1
Quiz
•
University
10 questions
Chapter 7 Non Conventional Machining
Quiz
•
University
10 questions
Guess the Artist (OPM)
Quiz
•
10th Grade - University
10 questions
5S Awareness
Quiz
•
1st Grade - Professio...
10 questions
Quiz-ApiFundamentalsWorkshop
Quiz
•
University
10 questions
Name the movie+show
Quiz
•
6th Grade - Professio...
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 Other
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
