Java Collections Quiz

Java Collections Quiz

University

47 Qs

quiz-placeholder

Similar activities

Pre-Test NS123

Pre-Test NS123

University

47 Qs

Lesson 1 Quiz: Spreadsheets using Excel

Lesson 1 Quiz: Spreadsheets using Excel

University

45 Qs

Unit 2.2 Making Marketing Decisions

Unit 2.2 Making Marketing Decisions

10th Grade - University

50 Qs

Software Engineering

Software Engineering

University

43 Qs

IP MIDTERM

IP MIDTERM

University

45 Qs

Let's Study NetFund ❦ 2

Let's Study NetFund ❦ 2

University

50 Qs

shell programing

shell programing

University - Professional Development

49 Qs

Rekayasa Perangkat Lunak

Rekayasa Perangkat Lunak

University

50 Qs

Java Collections Quiz

Java Collections Quiz

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Mr. Mourya

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

47 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output? List list = new ArrayList<>(); list.add("Java"); list.add("Python"); list.remove("Java"); System.out.println(list);

[Java]

[Python]

[Java, Python]

[]

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output? Set set = new TreeSet<>(); set.add(3); set.add(1); set.add(2); System.out.println(set);

[3, 2, 1]

[1, 2, 3]

[1, 3, 2]

[2, 1, 3]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be printed? List list = Arrays.asList(1, 2, 3); list.set(1, 5); System.out.println(list);

[1, 2, 3]

[1, 5, 3]

[5, 1, 3]

Compilation error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the result? Queue q = new PriorityQueue<>(); q.add(10); q.add(5); q.add(1); System.out.println(q.peek());

10

5

1

0

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Output? Deque dq = new LinkedList<>(); dq.addFirst("A"); dq.addLast("B"); System.out.println(dq);

[B, A]

[A, B]

[A]

[B]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does this code output? Stack stack = new Stack<>(); stack.push("X"); stack.push("Y"); stack.pop(); System.out.println(stack.peek());

X

Y

null

Compilation error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result? List list = new LinkedList<>(); 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

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