ArrayLists

ArrayLists

11th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

ZOOM QUIZ

ZOOM QUIZ

1st - 12th Grade

10 Qs

Visual C# Quiz - Chapter 5: Loops, Files, and Random Numbers

Visual C# Quiz - Chapter 5: Loops, Files, and Random Numbers

12th Grade

15 Qs

Python Basic Quiz

Python Basic Quiz

11th Grade - University

10 Qs

Ulangan harian 1 Algoritma dan Pemrograman

Ulangan harian 1 Algoritma dan Pemrograman

12th Grade - University

13 Qs

EMPTECH L4 Q3

EMPTECH L4 Q3

12th Grade

10 Qs

QUIZ 1 (HTML DASAR)

QUIZ 1 (HTML DASAR)

11th Grade

10 Qs

Tin 8/1

Tin 8/1

KG - University

10 Qs

Administrasi Server Jaringan

Administrasi Server Jaringan

12th Grade - University

15 Qs

ArrayLists

ArrayLists

Assessment

Quiz

Computers

11th - 12th Grade

Practice Problem

Medium

Created by

Lauren Olson

Used 62+ times

FREE Resource

AI

Enhance your content in a minute

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

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What will print when the code executes?

List<Integer> list1 = new ArrayList<Integer>();

list1.add(new Integer(1));

list1.add(new Integer(2));

list1.add(new Integer(3));

list1.add(2, new Integer(4));

list1.add(new Integer(5));

System.out.println(list1);

[1, 2, 3, 4, 5]

[1, 4, 2, 3, 5]

[1, 2, 4, 3, 5]

[1, 2, 4, 5]

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What will print?

List<String> list1 = new ArrayList<String>();

list1.add("Anaya");

list1.add("Layla");

list1.add("Sharrie");

list1.add(1, "Sarah");

System.out.println(list1);

["Anaya", "Sarah", "Layla", "Sharrie"]

["Anaya", "Layla", "Sharrie", "Sarah"]

["Sarah", "Anyar", "Layla", "Sarah"]

["Anaya", "Layla", "Sarah","Sharrie", ]

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What will be printed?

List<Integer> list1 = new ArrayList<Integer>();

list1.add(5);

list1.add(4);

list1.add(3);

list1.add(1, 2);

System.out.println(list1);

[5, 4, 3, 2]

[5, 4, 1, 3]

[2, 5, 4, 3]

[5, 2, 4, 3]

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What will be printed?

List<Integer> list1 = new ArrayList<Integer>();

list1.add(1);

list1.add(3);

list1.add(2);

list1.add(1);

System.out.println(list1);

[1, 3, 2]

[1, 3, 2, 1]

[1, 1, 2, 3]

[1, 2, 3]

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What will be printed?

List<Integer> list1 = new ArrayList<Integer>();

list1.add(new Integer(1));

list1.add(new Integer(2));

list1.add(new Integer(3));

list1.set(2, new Integer(4));

list1.add(2, new Integer(5));

list1.add(new Integer(6));

System.out.println(list1);

[1, 2, 3, 4, 5]

[1, 2, 4, 5, 6]

[1, 2, 5, 4, 6]

[1, 5, 2, 4, 6]

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be printed?

List<String> list1 = new ArrayList<String>();

list1.add("Anaya");

list1.add("Layla");

list1.add("Sharrie");

list1.set(1, "Destini");

list1.add(1, "Sarah");

System.out.println(list1);

["Sarah", "Destini", "Layla", "Sharrie"]

["Sarah", "Destini", "Anaya", "Layla", "Sharrie"]

["Anaya", "Sarah", "Sharrie"]

["Anaya", "Sarah", "Destini", "Sharrie"]

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be printed?

List<Integer> numList = new ArrayList<Integer>();

numList.add(new Integer(1));

numList.add(new Integer(2));

numList.add(new Integer(3));

numList.set(2,new Integer(4));

numList.add(1, new Integer(5));

numList.add(new Integer(6));

System.out.println(numList);

[1, 2, 3, 4, 5]

[1, 2, 4, 5, 6]

[1, 2, 5, 4, 6]

[1, 5, 2, 4, 6]

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?