hi there,
my programme stores all the coordinates from a text file into an arrayList. And from the arrayList I want to read out 3 elements at a time. Each element being a pair of (x, y) values already in a arrayList, e.g.[...., 34.123 2.121,....].
Now I need to read every 3 elements out from the arrayList as a set of 3 together, in a String.
my code fragment:
Iterator<String> itr = arrayList.iterator();
while(itr.hasNext())
{
String element = itr.next(); // this is just 1, how do i make it 3?
System.out.print(element + " ");
}
System.out.println();
thank you very much!