blob: d53906ddce1772683ec9408513f6d7845a51178e (
plain) (
tree)
|
|
scala> import collection.mutable._
import collection.mutable._
scala> val buf = new ListBuffer[Int]
val buf: scala.collection.mutable.ListBuffer[Int] = ListBuffer()
scala> buf += 22
val res0: scala.collection.mutable.ListBuffer[Int] = ListBuffer(22)
scala> buf ++= List(1, 2, 3)
val res1: scala.collection.mutable.ListBuffer[Int] = ListBuffer(22, 1, 2, 3)
scala> buf.toList
val res2: List[Int] = List(22, 1, 2, 3)
scala> :quit
|