I have an ArrayList full with String arrays that I can't figure out how to loop through. Iterators are new to me and even though I have used them in the past, I'm not sure what to do here.
Iterator<String[]> iterator = list.iterator();
while (iterator.hasNext()) {
String trip = "Till: " + iterator.next(0) + " | Från: " + list.get(4) + " | Kostar: " + list.get(1) +"kr | Avgår: " + list.get(2) + " | Ankomst Tid: " + list.get(3) + " | Antal bokningar: " + list.get(4);
This is some experimenting I am doing. I though that iterator.next() would return the StringArray on the current row so I have tried for example iterator.next(0). As I understand list.get(x) only gives me the row.
In the code above, I want every rows String Array at a certain index. Something like this:
for each row
system.out.println(String[2] +String[5]);