Java Collections Quiz

Java Collections Quiz

University

47 Qs

quiz-placeholder

Similar activities

GCSE Computer Science - 2.1-2.2

GCSE Computer Science - 2.1-2.2

University

43 Qs

1-50

1-50

University

50 Qs

Part 1 CAD:PRELIMENARY EXAMINATION

Part 1 CAD:PRELIMENARY EXAMINATION

University

45 Qs

Introduction to Computer

Introduction to Computer

University

50 Qs

Kiến thức về xử lý mảng 1 chiều trong C++

Kiến thức về xử lý mảng 1 chiều trong C++

University

50 Qs

UTS  TLM

UTS TLM

University

49 Qs

SP- Level 2

SP- Level 2

5th Grade - Professional Development

50 Qs

ict 1-50

ict 1-50

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