val list1 = List(1,2) val list2 = List(3,4)
then
list1::list2 returns: List[Any] = List(List(1, 2), 3, 4) list1:::list2 returns: List[Int] = List(1, 2, 3, 4)
I saw that the book says that when using :: it also outputs List[Int] = List(1, 2, 3, 4) . My version of Scala is 2.9.
scala
Hesey Jul 04 2018-11-11T00: 00Z
source share