1.

How Do I Append To The List?

Answer»

In scala to append into a LIST, use “:+” single value

VAR myList = List.empty[STRING]
myList :+= "a"
myList :+= "B"
myList :+= "C"
use++ for appending a list
var myList = List.empty[String]
myList ++= List("a", "b", "c")

In scala to append into a list, use “:+” single value

var myList = List.empty[String]
myList :+= "a"
myList :+= "b"
myList :+= "c"
use++ for appending a list
var myList = List.empty[String]
myList ++= List("a", "b", "c")



Discussion

No Comment Found