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
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).