标签:
val a = ArrayBuffer[Int]() a: scala.collection.mutable.ArrayBuffer[Int] = ArrayBuffer() scala> a+= 1 res4: a.type = ArrayBuffer(1) scala> a+= 2 res5: a.type = ArrayBuffer(1, 2) scala> a+= 4 res6: a.type = ArrayBuffer(1, 2, 4)
a+=(3,4,5,7)
res7: a.type = ArrayBuffer(1, 2, 4, 3, 4, 5, 7)
ArrayBuffer 相当于ArrayList 是有序的。
标签:
原文地址:http://www.cnblogs.com/zhanggl/p/4865664.html