Data structures exercise: Making a collection available to Java’s For Each loops
Published in
11 min readAug 5, 2021
One of the nice things about java.util.ArrayList
is that you can iterate through the contents of a list with an “enhanced” For loop called the “For Each” loop. For example, given
ArrayList<Transaction> trx = account.getTransactions();