WorksheetsCodeHS 5.4 & 5.5 ArrayList Stuff
Total questions: 10
Worksheet time: 7mins
Arrays have a fixed size.
true
false
ArrayLists have a fixed size.
true
false
How do we set up a class to use ArrayLists?
Select all that apply.
import java.util.*;
import java.lang.*;
import java.lang.ArrayList;
import java.ArrayList.*;
import java.util.ArrayList;
Write a line of code to add the value 23 to the end of ArrayList foo.
(a)
Write a line of code to change the value at index 5 in the ArrayList foo to 42.
(a)
Write a line of code to retrieve the value at index 9 from the ArrayList foo and assign it to the int bar.
(a)
Write a line of code to get the length of ArrayList foo.
(a)
Write a line of code to remove the element at index 7 from the ArrayList foo.
(a)
ArrayList implements
List
Array
ArrayList
Object
ListArray
An array is kinda like ...
a list
a group
a chess board
a phonebook ... wait, do you even know what that is?
