When instantiating a new ArrayList, which data types can we use? Select all that apply:
AP CS A Unit 7 Quiz PRACTICE

Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Scott Chamberlain
Used 3+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
3 mins • 3 pts
int
Integer
String
Double
double
2.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Consider the following code segment.
What is printed as a result of running this code segment?
[1, 2, 3, 4]
[2, 0, 3, 4]
[2, 3, 4]
[1, 3, 4]
[1, 0, 3, 4]
3.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Suppose the following line is used to replace /* Missing Code */.
System.out.println(list.get(0));
What is printed as a result of executing the code segment?
hotdog costs $2.0
soda costs $0.0
water costs $1.0
none costs $0.0
hotdog costs $2
4.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Suppose the following line is used to replace /* Missing Code */. System.out.println(list.get(list.size()-1)); What is printed as a result of executing the code segment?
water costs $1.0
water costs $1
hamburger costs $3.5
none costs $0.0
There is an error that occurs because we are trying to access an index out of range
5.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Suppose the following lines are used to replace /* Missing Code */. list.remove(1);
System.out.println(list.get(1)); What is printed as a result of executing the code segment?
soda costs $-3.0
soda costs $0.0
hotdog costs $2
hotdog costs $2.0
water costs $1.0
6.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
After running the code, what is the size of bulbs?
2
3
4
5
6
7.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Consider the following method that is intended to test if all the Strings in the ArrayList start with a lowercase letter.
Which of the following could replace /* Missing Code */ so that the method works as intended? (You may assume all strings in the ArrayList begin with a letter character.)
I only
II only
III only
II and III
I, II, and III
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
2D Arrays

Quiz
•
9th - 12th Grade
11 questions
Python strings

Quiz
•
8th - 9th Grade
10 questions
Arrays

Quiz
•
10th - 12th Grade
11 questions
Java ArrayLists

Quiz
•
10th Grade
15 questions
Javascript

Quiz
•
10th - 12th Grade
15 questions
Topic 3 & 4 Practice - ArrayList and String Methods

Quiz
•
12th Grade
12 questions
Unit 7 - ArrayList - Test Review

Quiz
•
9th - 12th Grade
10 questions
Introduction to Arrays

Quiz
•
KG - University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University