Closed wyljpn closed 4 years ago
2.Oracle Java TutorialsのPausing Execution with Sleepのコード例を、IDEからScalaで実装して実行結果を貼り付けて下さい。
package kadai09 object SleepMessages { def main(args: Array[String]): Unit = { val importantInfo = Array("Mares eat oats", "Does eat oats", "Little lambs eat ivy", "A kid will eat ivy too") for (i <- importantInfo.indices) { //Pause for 4 seconds Thread.sleep(4000) //Print a message println(importantInfo(i)) } } }
output:
Mares eat oats Does eat oats Little lambs eat ivy A kid will eat ivy too
OKです!
2.Oracle Java TutorialsのPausing Execution with Sleepのコード例を、IDEからScalaで実装して実行結果を貼り付けて下さい。
output: