Scala循环操作
val buf = new scala.collection.mutable.ArrayBuffer[Int]
for (i <- 0 to 10) {
buf += i
}
buf += 11
buf.foreach(u =>println(u + "\t"))
val bufPerson = new scala.collection.mutable.ArrayBuffer[Person]
for (i <- 0 to 10) {
bufPerson += new Person("Alice"+i, 25);
}
bufPerson.foreach(u =>println(u + "\t"))
// 数组