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 the book writes that when use ::
it also results List[Int] = List(1, 2, 3, 4)
. My Scala version is 2.9.