CollectionsFramework

CollectionsFramework

University

30 Qs

quiz-placeholder

Similar activities

Arduino

Arduino

University

25 Qs

Sección 2 - Curso Oracle

Sección 2 - Curso Oracle

University

25 Qs

Computer Programming Midterms

Computer Programming Midterms

University

25 Qs

ITE6 Prelim exam BSIT 2-3

ITE6 Prelim exam BSIT 2-3

University

25 Qs

kuis organisasi komputer

kuis organisasi komputer

University

25 Qs

Quiz No. 2 - The Process of Interaction Design

Quiz No. 2 - The Process of Interaction Design

University

25 Qs

WJEC Image Editing

WJEC Image Editing

KG - Professional Development

25 Qs

CCC4 Chapter 1 - Introduction to Computers

CCC4 Chapter 1 - Introduction to Computers

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.

Create a free account and access millions of resources

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?