CollectionsFramework

CollectionsFramework

University

30 Qs

quiz-placeholder

Similar activities

Script_programming_test

Script_programming_test

University

25 Qs

Microsoft Word Quiz

Microsoft Word Quiz

University

25 Qs

Round 2

Round 2

University

25 Qs

Fundamentos Videojuegos Unity2

Fundamentos Videojuegos Unity2

University

25 Qs

Keamanan Jaringan dan Firewall

Keamanan Jaringan dan Firewall

University

25 Qs

data mining

data mining

University

30 Qs

The SemiColons Quiz

The SemiColons Quiz

University

25 Qs

Unity. CharacterController

Unity. CharacterController

7th Grade - University

25 Qs

CollectionsFramework

CollectionsFramework

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

Satish T

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers