Arrays and ArrayLists Review

Arrays and ArrayLists Review

9th - 12th Grade

18 Qs

quiz-placeholder

Similar activities

quizz tkinter

quizz tkinter

11th Grade - University

20 Qs

4th Quarter SketchUp Review

4th Quarter SketchUp Review

10th Grade

15 Qs

ICT WEBINAR QUIZ

ICT WEBINAR QUIZ

KG - Professional Development

20 Qs

Computer Fundamentals

Computer Fundamentals

10th Grade

20 Qs

ICT S120 (Prelim Review)

ICT S120 (Prelim Review)

11th Grade

15 Qs

Input, output and storage de

Input, output and storage de

8th Grade - Professional Development

14 Qs

Text and Image representation

Text and Image representation

11th Grade

22 Qs

9G4 CS Python Programming Sequence and Vocabs

9G4 CS Python Programming Sequence and Vocabs

9th Grade

13 Qs

Arrays and ArrayLists Review

Arrays and ArrayLists Review

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Alexandria Robles

FREE Resource

AI

Enhance your content in a minute

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

18 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the ArrayList nums if it is initially [5, 3, 1] and the following code is executed?

nums.add(6);

nums.add(0, 4);

nums.remove(1);

[4, 3, 1, 6]

[5, 3, 1, 6]

[4, 3, 6]

[4, 5, 3, 6]

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which statement below is the correct way to retrieve the first element in the nums ArrayList?

nums.get(0)

nums[0]

nums(0)

nums[1]

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Given the ArrayList nums with the values [3, 7, 6, 0], what code below is the proper way to change the 7 to be a 5?

nums.set(1, 5)

nums.set(7, 5)

nums.set(5, 2)

nums[2] = 5

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Given the nums ArrayList with the values [5, 4, 3, 2], what statement below removes the value 3 from the list?

nums.remove(2)

nums.remove(3)

nums.get(2) = null

nums.remove(1)

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Given the nums ArrayList with the values [1, 2, 3, 4, 6], what code below can be used to add a 5 between the 4 and 6 in the list?

nums.add(4, 5)

nums.add(5, 4)

nums.add(5, 5)

nums.add(5)

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which statement is the correct declaration and initialization of an ArrayList of String values?

ArrayList<String> name;

name = new ArrayList<String>();

ArrayList name;

name = new ArrayList<String>();

ArrayList<String> name;

name = ArrayList<String>();

String<ArrayList> name;

name = new String<ArrayList>();

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is printed?

ArrayList<Integer> alist;

alist = new ArrayList<Integer>();

alist.add(1);

alist.add(2);

alist.remove(1);

alist.add(1, 3);

alist.set(1, 4);

alist.add(5);

System.out.println(alist);

[1, 4, 5]

[1, 4, 3, 5]

[2, 4, 5]

[2, 4, 3, 5]

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?