在Scala中,说我有两个列表
scala> val oneTwo = List(1,2)
oneTwo: List[Int] = List(1, 2)
和
scala> val threeFour = List(3,4)
threeFour: List[Int] = List(3, 4)
我可以做符连接列表:
scala> oneTwo ::: threeFour
res30: List[Int] = List(1, 2, 3, 4)
或者
scala> oneTwo ++ threeFour
res31: List[Int] = List(1, 2, 3, 4)
是什么这两种方法之间的区别?
谢谢。