Practical Coding in Java

Learn to write and validate your own code

Darren Kessner, PhD

(revised October 21, 2025)

Previous: Coding Exercises: Arrays

6. ArrayList

In this chapter we explore the ArrayList, which is a data structure similar to the array. However, the ArrayList is a class, and offers more flexibility for many applications.

In the example you will see how to declare, initialize, and accesss an ArrayList. You will also learn how to iterate through ArrayLists using loops. And you will practice performing calculations on ArrayLists.


Next: