Nice work! You now know the basics of ArrayLists including:

  • Creating an ArrayList.
  • Adding a new ArrayList item using add().
  • Accessing the size of an ArrayList using size().
  • Finding an item by index using get().
  • Changing the value of an ArrayList item using set().
  • 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…


We’ve included a workspace for you to test out your newfound knowledge of arrays and ArrayLists.

Remember: To run your code, enter the following in the terminal:

java List

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?