Hi there,
I am not good with Java. Can someone explain this for loop for me please. For a for loop, to my understanding the syntax goes something like,
for(int i = 0; i < someNumber; i++) {
//...some code...
}
but in this one I have seen, the for loop doesn't have what I expect. What is going on, can someone explain? I found the code on the web, but even with the unfamiliar syntax and without the {} brackets, it seems to compile and work fine.. as a Java project, I think.
What's going on in the second line?
P[] closest = findClosest(points);
for (P p : closest)
System.out.println(p);
Thank you!