Java Collections Quiz

Java Collections Quiz

University

47 Qs

quiz-placeholder

Similar activities

ALGORITHM AND FLOWCHART

ALGORITHM AND FLOWCHART

12th Grade - University

51 Qs

Simulado_Python_ADS

Simulado_Python_ADS

University

52 Qs

Ujian IoT PTS 2024 45 Soal

Ujian IoT PTS 2024 45 Soal

11th Grade - University

45 Qs

ACO.C1.HTTT

ACO.C1.HTTT

University

44 Qs

CompTIA ITFundamentals CRAM

CompTIA ITFundamentals CRAM

6th Grade - University

46 Qs

MES3093: QUIZ

MES3093: QUIZ

University

50 Qs

Computer memory

Computer memory

University

45 Qs

Penilain Harian 2

Penilain Harian 2

9th Grade - 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