CollectionsFramework

CollectionsFramework

University

30 Qs

quiz-placeholder

Similar activities

Batch 1 Quiz - DSA Lab

Batch 1 Quiz - DSA Lab

University

25 Qs

MD CC104 -MIDTERM LONG QUIZ

MD CC104 -MIDTERM LONG QUIZ

University

30 Qs

Estructura de Datos

Estructura de Datos

University

25 Qs

java collections

java collections

University

31 Qs

Collections

Collections

University - Professional Development

30 Qs

Technical quiz(Medium-Level)

Technical quiz(Medium-Level)

University

25 Qs

Introduction - Data Structures

Introduction - Data Structures

University

25 Qs

ICT 1 (H1H2)

ICT 1 (H1H2)

University

25 Qs

CollectionsFramework

CollectionsFramework

Assessment

Quiz

Computers

University

Medium

Created by

Satish T

Used 2+ times

FREE Resource

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

How to retrieve all keys from a Map?
map.entries()
map.keySet()
map.getKeys()
map.getAll()
map.getKeysList()

Answer explanation

map.keySet() returns a Set of keys.

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Set<Integer> s = new HashSet<>(); s.add(1); s.add(1); s.size(); // What is the size?
0
1
2
Exception
Depends on JVM

Answer explanation

Set doesn't allow duplicates. Only one element remains.

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Stack is which type of structure?
FIFO
LIFO
Tree
Graph
Heap

Answer explanation

Stack is Last-In-First-Out.

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

TreeSet stores elements in which order?
Insertion order
No order
Natural order
Reverse order
Hash order

Answer explanation

TreeSet sorts elements in natural order.

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What does ListIterator allow?
Only forward iteration
Only reverse
Forward and backward
No iteration
Only last element

Answer explanation

ListIterator supports bi-directional traversal.

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What does poll() return when queue is empty?
Exception
null
0
-1
head

Answer explanation

poll() returns null if queue is empty.

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What does removeIf() method do?
Sort list
Remove last element
Remove conditionally
Add element
Clear all

Answer explanation

removeIf() removes items matching predicate.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?