千巷猫影
Arrays are mutable, indexed collections of values. Array[T] is Scala's representation for Java's T[].Array:可变用下标访问,利于随机访问是Java数组的一种表示List is a class for immutable linked lists representing ordered collectionsof elements of type A.This class comes with two implementing case classes scala.Nil and scala.:: that implement the abstract members isEmpty, head and tail.This class is optimal for last-in-first-out (LIFO), stack-like access patterns. If you need another accesspattern, for example, random access or FIFO, consider using a collection more suited to this than List.List:不可变为后进先出做了优化,像栈一样的访问模式支持用::在模式匹配中取出head和tail