Learn
Nice work! You now know the basics of ArrayList
s including:
- Creating an
ArrayList
. - Adding a new
ArrayList
item usingadd()
. - Accessing the size of an
ArrayList
usingsize()
. - Finding an item by index using
get()
. - Changing the value of an
ArrayList
item usingset()
. - Removing an item with a specific value using
remove()
. - Retrieving the index of an item with a specific value using
indexOf()
.
Now if only there were some way to move through an array or ArrayList
, item by item…
Instructions
We’ve included a workspace for you to test out your newfound knowledge of arrays and ArrayList
s.
Remember: To run your code, enter the following in the terminal:
java List
Take this course for free
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.