
ArrayLists
Authored by Maddie Mihevc
Computers
University
Used 16+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If we have an ArrayList instruction with the element “Stop” at index 5, how do we change the string at 5 to “Go”?
list.add(5, "Go")
list.add(4, "Go")
list.set(5, "Go")
list.set(4, "Go")
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You can use the set method to place an element in a list at any index you want
true
false
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You can use the add method to place an element in a list at any index you want
true
false
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If aList is an object of the class ArrayList<String> that contains four strings “red”, “blue”, “green”, and “yellow”, what is the order of the strings on the list after aList.add(2, “orange”); ?
{“red”, “blue”, “orange”, “green”, “yellow”}
{“red”, “orange”, “blue”, “green”, “yellow”}
{“red”, “blue”, “green”, “orange”, “yellow”}
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If you create a list using
ArrayList<Double> doubleList = new ArrayList<Double>(20);
can the list contain more than 20 elements?
Yes because capacity isn't fixed
No because capacity is fixed
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you decrease the current capacity to the current size?
trimToSize()
clear()
trim()
decreaseCapacity()
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between ArrayList size and capacity?
size is the number elements in the list while capacity is the maximum number of elements it can hold without resizing
capacity is the number elements in the list while size is the maximum number of elements it can hold without resizing
both represent the number of elements in the list
both represent the number of elements the list can hold before resizing
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
margaret hamilton
Quiz
•
University
9 questions
BASIC HTML
Quiz
•
University
10 questions
Initial Assessment - Cybersecurity Awareness
Quiz
•
9th Grade - Professio...
10 questions
Firewall Basic
Quiz
•
University
10 questions
Software Testing
Quiz
•
University
10 questions
C++ Array Quiz
Quiz
•
University
10 questions
Node.js
Quiz
•
University
10 questions
PHP Introduction - Assignment 1
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade