この種の構文を見たのはこれが初めてです:
// class Node
public class Node {
...
...
}
public class Otherclass { ... }
Otherclass graph = new Otherclass();
// getSuccessors is a method of Otherclass class
Node currentNode ;
List<Node> successors = graph.getSuccessors(currentNode);
// weird for loop
for (Node son : successors) {
// do something
}
forループとは何ですか?ある種のMatlab構文?
forループを書く他の方法はありますか?
よろしく