Drag the edges to resize the window.

Code Editor
Data Structures


Fantastic! For loops will be useful when reading and manipulating Java data structures. Let's talk about a few data structures that are built into Java. The first data structure we will explore is called the ArrayList.

The ArrayList stores a list of data of a specified type. Let's go through an example of how to create, or declare, an ArrayList of type Integer.

ArrayList<Integer> quizGrades = new ArrayList<Integer>();

ArrayList is a pre-defined Java class. To use it, we must first create an ArrayList object.

In the example above, we create an ArrayList object called quizGrades that will store data types belonging to the <Integer> class (whole numbers).

Report a Bug
If you see a bug or any other issue with this page, please report it here.