How do I iterate over a Java array of variable length.
I guess I would setup a while loop, but how would I detect that I have reached the end of the array.
Arrays have an implicit member variable holding the length:
for(int i=0; i
Alternatively if using >=java5, use a for each loop:
for(Object o : myArray) { System.out.println(o); }