6 ms·
In scala you would use a for-comprehension to get the same effect: for (p <- persons; if p.getAge >= 18) { println(p); }
by jmreardon 15y ago
In scala you would use a for-comprehension to get the same effect:
for (p <- persons; if p.getAge >= 18) {
println(p);
}