Created
November 6, 2011 16:53
-
-
Save notyy/1343162 to your computer and use it in GitHub Desktop.
bad
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test3() { | |
val fruits = Array("apple", "orange", "banana") | |
for (i <- fruits.indices) { | |
val fruit = fruits(i) | |
Actor.actor { | |
for (j <- 1 to 3) { | |
println(j+" : "+fruit) | |
Thread.sleep(5000) | |
} | |
} | |
} | |
} |
def test3() {
val fruits = Array("apple", "orange", "banana")
for (i <- fruits.indices) {
val fruit = fruits(i)
Actor.actor {
for (j <- 1 to 3) {
println(j+" : "+fruit)
Thread.sleep(5000)
}
}
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In order not to be confused , it ts better change the code snippet
println(j+" : "+fruit)
toprintln((i + j) +" : "+fruit)
·