I want to use an iterator to step through an ArrayList (apparently its better than using get(i)), but I keep running into errors:
//When declared as
ArrayList<Thing>[] things = new ArrayList[3];
//then
Iterator myThing = things[0].iterator();
//error: 'cannot find symbol. symbol: Iterator. class: the class where this code appears
//Or like this:
List<Thing>[] things = new ArrayList[3];
//error:type java.awt.list does not take parameters
//Or:
List[] things = new ArrayList[3]
//error: incompatible types. found: java.util.ArrayList[]. required: java.util.List[]
Hope someone can explain to me how to correctly declare my 'things' and generate an iterator to step through them. I've seen examples on this forum which look identical to what I've typed, but I must be doing something wrong...