
ArrayList Practice

Flashcard
•
Computers
•
9th - 12th Grade
•
Hard
Quizizz Content
FREE Resource
Student preview

15 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What index value is used to locate the last element in the nums ArrayList?
Back
nums.size()-1
2.
FLASHCARD QUESTION
Front
Which statement below is the correct way to retrieve the first element in the nums ArrayList? Options: nums.get(0), nums[0], nums(0), nums[1]
Back
nums.get(0)
3.
FLASHCARD QUESTION
Front
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? Options: nums.set(1, 5), nums.set(7, 5), nums.set(5, 2), nums[2] = 5
Back
nums.set(1, 5)
4.
FLASHCARD QUESTION
Front
Which statement is the correct declaration and initialization of an ArrayList of String values? Options: 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>();
Back
ArrayList<String> name;
name = new ArrayList<String>();
5.
FLASHCARD QUESTION
Front
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);
Back
[4, 3, 1, 6]
6.
FLASHCARD QUESTION
Front
What index value is used to locate the last element in the nums ArrayList?
Back
nums.size()-1
7.
FLASHCARD QUESTION
Front
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);
Back
[4, 3, 1, 6]
Create a free account and access millions of resources
Similar Resources on Wayground
18 questions
Java Arrays

Flashcard
•
9th - 12th Grade
12 questions
JavaScript Programming Concepts

Flashcard
•
9th - 12th Grade
10 questions
❄⛄AP CSA - Unit 6 Review

Flashcard
•
9th - 12th Grade
9 questions
Microsoft Outlook Flashcard Review Game-2

Flashcard
•
9th - 12th Grade
9 questions
PYTHON -- Lists (short)

Flashcard
•
9th - 12th Grade
15 questions
Algebra II Final Exam

Flashcard
•
9th - 12th Grade
7 questions
GD: Unit 4

Flashcard
•
9th - 12th Grade
10 questions
Arrays

Flashcard
•
10th - 12th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade
Discover more resources for Computers
50 questions
Trivia 7/25

Quiz
•
12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade
6 questions
RL.10.1 Cite Evidence

Quiz
•
10th Grade
10 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
14 questions
Algebra 1 SOL Review #1

Quiz
•
9th Grade