for (int u: adjList.get(v))
{
instructuion
}
While processing an algorithm, I came across this Java syntax of the "For" loop that I can't figure out. I know that usually it is used like this:
for (int i=0; i < 6; i++) {
instructuion
}
What intrigues me here is the ":" in int u: adjList.get(v)
. I know perfectly well that adjList is a list and u a variable of type integer.
I searched many sites, but none of them gave details on this syntax.