This is the first time that I\'ve seen this kind of syntax :
// class Node
public class Node {
...
...
}
public class Otherclass { ... }
Otherclass gra
That is a for-each loop (also called an enhanced-for
.)
for (type var : arr) { //could be used to iterate over array/Collections class
body-of-loop
}
The basic for loop was extended in Java 5 to make iteration over arrays and other collections more convenient. This newer for statement is called the enhanced for or for-each
(Documentation)