Tag Archives: loop

Looping through a List in Processing

Here is a piece of demonstration code to use various ways to loop through a List or ArrayList in Processing, i.e. Java. The first two examples use for loop and the third one uses the while loop.   We initialize the ArrayList with random integers. ArrayList<Integer> iList = new ArrayList<Integer>(); iList.add(floor(random(10))); iList.add(floor(random(10))); iList.add(floor(random(10)));ArrayList<Integer> iList = […]

Posted in Software, Testing | Also tagged | Comments closed