for-each
Java Loops
for (T x : c)
Flowchart (ISO 5807)
Source code
class P {
static int count(int[] a, int key) {
int c = 0;
for (int x : a) {
if (x == key) c++;
}
return c;
}
} for (T x : c)
class P {
static int count(int[] a, int key) {
int c = 0;
for (int x : a) {
if (x == key) c++;
}
return c;
}
}