Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Scala'da Döngü İfadeleri Yazımdaki Örnek 3
// Java
for (int i = 1; i <= 20; i += 2) {
for (j = i; j <= i * 2 && j < 14; j++) {
System.out.print("[" + i + ", " + j + "] ");
}
}
// Scala
for {
i <- 1 to 20 by 2
j <- i to (i * 2) if j < 14
} {
print("[" + i + ", " + j + "] ")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.