object Dome13ListBuffer {
def main(args: Array[String]): Unit = {
/**
*可变集合
* listBuffer
* scala.collection.mutable.所在集合
*scala.collection.immutable
*/
val as: ListBuffer[Int] = new ListBuffer[Int]
//增加元素
as += 5
as += 10
as += 111
// 指定下标插入元素
as.insert(1,100)
println(as)
as.remove(2)
println(as)
//插入多个元素 一个集合
as ++= List(1,2,3)
println(as)
//类型转换
as.toList.toStream.toString.toLowerCase.toList
println(as)
//遍历集合
as.foreach(println)