Since Scala does not have old Java style for loops with index,
for
// does not work val xs = Array(\"first\", \"second\", \"third\") for (i=0; i<
Looping in scala is pretty simple. Create any array of your choice for ex.
val myArray = new Array[String](3) myArray(0)="0"; myArray(1)="1"; myArray(2)="2";
Types of loops,
for(data <- myArray)println(data) for (i <- 0 until myArray.size) println(i + ": " + myArray(i))